AnsweredAssumed Answered

swUserPreferenceIntegerValue_e not listing all options

Question asked by Brian Smith on Jun 7, 2017
Latest reply on Jun 8, 2017 by Brian Smith

    When I call the below I says that swUnitsMassPropLength method is not found for swUserPreferenceIntegerValue. It only lists swAutoSaveInterval as an options for swUserPreferenceInteger. This is part of a macro that traverses and assembly and fixes multiple issues. It seems that no matter where i run this, it errors out.


Sub Unitfixer(swmodel As ModelDoc2)

    boolstatus = swmodel.Extension.SetUserPreferenceInteger(swUserPreferenceIntegerValue_e.swUnitsMassPropDecimalPlaces, 0, 0)

End Sub


But, when I run this recorded macro I have no issues:


Sub main()

Dim swApp As Object

Dim Part As Object

Dim boolstatus As Boolean

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc

boolstatus = Part.Extension.SetUserPreferenceInteger(swUserPreferenceIntegerValue_e.swUnitsMassPropDecimalPlaces, 0, 0)

End Sub


What is the difference? What am I doing wrong?