2 Replies Latest reply on Jun 27, 2018 4:06 AM by Cuong Vo Ta

    How to change the STL Quality with SetUserPreferenceIntegerValue

    Cuong Vo Ta

      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


      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!