Hey guys!
I am working on an Add-In which creates STLs of an open file. So far it is working but I would like to have the decision to create low and high quality STL files. I'm using C# btw.
I found this site here: 2017 SOLIDWORKS API Help - System Options > Export > STL
So this is my method now:
public void setExportQuality()
{
ModelDoc2 doc = SWConnector.Instance.ActiveDocument; //SWConnector is a different class
doc.SetUserPreferenceIntegerValue((int)swUserPreferenceIntegerValue_e.swSTLQuality, (int)swSTLQuality_e.swSTLQuality_Coarse);
}
The problem is that it does not change anything in the doc.file. When I use this method here
"GetUserPreferenceIntegerValue(swUserPreferenceIntegerValue_e.swSTLQuality)"
I get the int value 0. But it should be 1! I tried it the whole day it is so frustrating. Did I miss something here? Why is the method not changing the STL quality? I hope that you understand my request, it is my first Request here in the SW forum. Please let me know if I did something wrong or if you need more informations!
This is an application level setting so you should call SetUserPreferenceIntegerValue method on ISldWorks pointer not on IModelDoc2 pointer (i.e. app, not doc)