.IFC to .STEP Conversion using ASPOSE.CAD

Hi, I want to convert .IFC file to .STEP file using c# .Net with the use of Aspose.CAD, converted step file not open in solid works application, as well, are there any options in the ASPOSE library to stitch the faces using the wire/edges?

@krunal1059

Cause

The issue you’re experiencing with the .STEP file not opening in SolidWorks is likely due to the conversion process of the .IFC file. While the Aspose.CAD library supports various file formats, the conversion may not always produce results that are fully compatible with all applications.

Solution

To convert an .IFC file to a .STEP file using Aspose.CAD in C#, you can follow this approach. Ensure that the Aspose.CAD library is referenced in your project.

Code

Here’s a basic example of how to perform the conversion:

using Aspose.CAD;
using Aspose.CAD.FileFormats.IFC;
using Aspose.CAD.FileFormats.STEP;

public void ConvertIfcToStep(string inputIfcPath, string outputStepPath)
{
    // Load the IFC file
    using (var ifcImage = Image.Load(inputIfcPath))
    {
        // Save as STEP format
        ifcImage.Save(outputStepPath, new StepOptions());
    }
}

Make sure to replace inputIfcPath and outputStepPath with the actual paths of your files.

Next Steps

  1. Check Compatibility: After conversion, attempt to open the .STEP file in SolidWorks again. If it still does not open, verify the settings in SolidWorks for compatibility with the STEP format.

  2. Stitching Faces: If you need to stitch faces using edges or wires, note that Aspose.CAD does not directly provide a method for this in the conversion process. You may need to preprocess the .IFC file or use additional CAD software to achieve this before conversion.

  3. Consult Documentation: For more advanced techniques and options, refer to the Aspose.CAD documentation on advanced export techniques here.

If you have any further questions or need additional assistance, please let me know!

@krunal1059,
Hello,
could you please attach some sample file and the code you use, so we can investigate this on our end.

I have couple of questions.

  1. Could you help clarify why the STEP file exported from an OBJ isn’t opening or working correctly in SolidWorks?

  2. How does the stitching process work during OBJ to STEP conversion, and why does this approach not apply to IFC files?

  3. Since IFC files already contain face data, could you explain what is meant by “preprocessing and getting face data” in this context?

@krunal1059,
Hello,
you are asking our AI-bot, it will not answer, let me try to do this for you :slight_smile:

1.Please attach the initial file, the broken file, and the code sample you used to convert it, so we can reproduce the issue on our side, investigate the reasons and make proper fixes. We can only guessing what is incorrect without the file.

2-3. IFC format is much more complex to export compared to OBJ. So we have limited functionality for it yet, the 3D geometry is split into lines and the drawing is exported as lines, not faces, surfaces, meshes, etc.

@oleksii.gorokhovatskyi ,
Hello,

I am attaching an .obj file, a .step file, and sample C# code that can convert the .obj file to a .step file using the Aspose library.

We are able to convert the .obj file to a .step file, but we are unable to open it in the SolidWorks application.

Our requirement is to open the .step file in the SolidWorks application.

Sample.zip (1.4 MB)

image.png (44.3 KB)

@krunal1059,
thank you for details, we have logged CADNET-10177 to investigate this case.

1 Like

@oleksii.gorokhovatskyi ,

Waiting for your response.

I hope I can see the CADNET-10177 investigation response here

@krunal1059,
Hi.
Could you please test if it is possible to view attached files (ResultsWithLicense, NoLicense, ResultsNoLicense, ResultsWithLicenseFixed) in SolidWorks on your side? Could you please provide some screenshots or other data with the errors in SolidWorks software for the previously generated files and for these ones if failed?

Here are the conversion options that seem to fit better:

	var stpOptions = new StpOptions();
	stpOptions.VectorRasterizationOptions = new CadRasterizationOptions
	{
		Quality = new RasterizationQuality { ObjectsPrecision = RasterizationQualityValue.Medium },
		DrawType = CadDrawTypeMode.UseObjectColor,
	};

	// Export to STP
	inputImage.Save(outFileStp, stpOptions);

ResultsWithLicense.zip (168.6 KB)

NoLicense.zip (1.1 MB)

ResultsNoLicense.zip (1.1 MB)

ResultsWithLicenseFixed.zip (168.9 KB)

Hello @oleksii.gorokhovatskyi,

Thank you for your response.

I checked the STEP files you provided in SolidWorks. The files (ResultsWithLicense, ResultsNoLicense, and ResultsWithLicenseFixed) display a warning stating “The file does not contain any geometry data” and are displayed as graphics only. Is there any possibility that the ASPOSE library can open these files in SolidWorks with geometry data? If it is possible, I am ready to purchase a license for the ASPOSE CAD library.

image.png (7.9 KB)
image.png (82.5 KB)
image.png (147.3 KB)

The (NoLicense) STEP file gave an error.

image.png (12.9 KB)

** I have attached the response from the SolidWorks application.

Can you close this activity as soon as possible, so we can plan accordingly?

@krunal1059,
Hello,
so according to these results we will apply the fix for the STP files formation so they could be opened in SolidWorks.

Regarding geometry and graphics data we have only support for graphics when exporting to STP at the moment for all formats. This can not be implemented neither quickly nor easily unfortunately. Additionally, OBJ format is considered as “mesh” format that contains mostly individual faces (like triangles) but not the exact geometry as STP file (as the format that is much more rich) refers to. Both cube.obj and sephere.obj contains triangular faces only and they are converted into STP as is.

@oleksii.gorokhovatskyi,
Thank you for the updates.

You mentioned that your team will fix the issue. If I purchase the license, how long will it take for your team to resolve the issue and display the .step file in SolidWorks with geometry data?

@krunal1059,

The problem we will fix is about the opening file, it does not relate to geometry/graphics, it is a separate problem to make STP file more stable to open in different viewers.

Right now we are focused on the implementation of basic support for export into STP from different formats and we don’t have plans to look at this issue. We don’t know if this is feasible at all for the OBJ format. It might not be too difficult for a sphere or cube, but much more difficult for more complex objects.

@oleksii.gorokhovatskyi,

Geometry data would be okay, we can still go with Dum solid parts, but do you need time to fix the current issues where we are not able to open STP file generated from trial version? Can you provide us another trial version, so we can execute our code and test the STP files in different CAD software like SolidWorks, CREO, NX, CATIA etc.

We just need clarity that if we buy a license, then our STP file should get open in all CAD files. Let me know if you can provide the clarity, we will buy the license

Request you to please close this asap.

@krunal1059,
The fix for file opening will be available in the upcoming Aspose.CAD for .NET 25.7 release next week.

You can generate free evaluation license in Purchase Portal, apply it and test full functionality of the product. Please add the products to the cart, view it, click “Proceed” and “Get a Temporary License” next.

We encourage you to verify all required functionality before the purchase.

@oleksii.gorokhovatskyi ,
Thank you for the updates.

My teammate Devang from Engineering Intent will apply from the evaluation license for ASPOSE.CAD.
Once Aspose.CAD for .NET 25.7 release, we will verify all required functionality.

1 Like

@oleksii.gorokhovatskyi ,
Hey, please update me once Aspose.CAD for .NET 25.7 is released.

@oleksii.gorokhovatskyi ,

I also want to know how an application works using a JavaScript license. Can you please send me sample code? Also, where can our uploaded data be saved? I have tried using the ‘npm i aspose-cad’ package, but it gives me an error as shown below:

image.png (1.9 KB)

@krunal1059,
Hi,
I will post message here once 25.7 is available.

As I can see this example works , but Aspose.CAD for JavaScript is more a concept for now. This product is currently outdated and it appears there is no way to set license, we have plans to continue the development of it, but not in near future.

A post was split to a new topic: Support for STP format