Writing solids as stl

Technical discussions
Post Reply
George Silva
Posts: 4
Joined: Fri Jun 14, 2019 3:30 am

Writing solids as stl

Post by George Silva »

Hello
I am trying to write solids, which come from union and subtract operations with cylinders. The saved stl comes up empty.
I do it via IModel_DG.SaveEx("D:\Temp\result.stl", null). Saving using the same call with .step extension is working. Do I need the second parameter for stl?
Thank you
George Silva

Prashant Kande
Posts: 121
Joined: Mon Apr 04, 2016 4:55 am

Re: Writing solids as stl

Post by Prashant Kande »

Hi George

This seems to be working in my check. It is same as IModel_DG.Save("D:\Temp\result.stl").
Please check your model in model explorer (context menu). Structure of sub-shapes can be checked using Shape Explorer sample.

You do not have to supply the options, but the user will get a pop-up asking save as binary or text.

Code: Select all

IDictionary_DG options;
options.SetBool("Binary", true);
options.SetBool("Verbose", false);
iModelDG.SaveEx("D:\Temp\result.stl", options);
A new dictionary can be constructed as:

Code: Select all

IModel_DG iModel = m_dgKernel.GetModel() as IModel_DG;
IObjectGenerator_DG generator = iModel as IObjectGenerator_DG;
IDictionary_DG options = generator.Create("Dictionary_DG") as IDictionary_DG;
Sorry, we have found a bug in SaveEx(). Please get today's update.

Regards

George Silva
Posts: 4
Joined: Fri Jun 14, 2019 3:30 am

Re: Writing solids as stl

Post by George Silva »

Thank you, Prashant
It is working now. It was an issue on my side. The object was a wireframe actually
regards
George

Post Reply