sfaz
Industrial
- Jun 22, 2011
- 8
Hello, i need a macro to change some settings , like units, font size, arrow size etc. i copied this macro from a thread and it worked great i tried to add mass units property but i didnt have any success( i wrote what i thought was logic (i don't know anything about writing programs).
is there a list of codes for document settings and their values that i can check so i can just add to my macro. example the code for units is swUnitsLinear and values are swINCHES, swCM etc etc.
so i dont have to keep asking everytime i want to add a new setting to the macro
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
Part.SetUserPreferenceToggle swDetailingDualDimensions, True
Part.SetUserPreferenceToggle swDetailingShowDualDimensionUnits, True
Part.SetUserPreferenceIntegerValue swDetailingDualDimPosition, swDualDimensionsOnBottom
Part.SetUserPreferenceIntegerValue swUnitsLinear, swINCHES
Part.SetUserPreferenceIntegerValue swUnitsLinearDecimalPlaces, 3
Part.SetUserPreferenceIntegerValue swUnitsAngularDecimalPlaces, 2
Part.SetUserPreferenceIntegerValue swUnitsDualLinear, swCM
Part.SetUserPreferenceIntegerValue swUnitsDualLinearDecimalPlaces, 2
Part.SetUserPreferenceIntegerValue swUnitsMass, swKG <-------------
End Sub
ok
thanks in advance
is there a list of codes for document settings and their values that i can check so i can just add to my macro. example the code for units is swUnitsLinear and values are swINCHES, swCM etc etc.
so i dont have to keep asking everytime i want to add a new setting to the macro
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
Part.SetUserPreferenceToggle swDetailingDualDimensions, True
Part.SetUserPreferenceToggle swDetailingShowDualDimensionUnits, True
Part.SetUserPreferenceIntegerValue swDetailingDualDimPosition, swDualDimensionsOnBottom
Part.SetUserPreferenceIntegerValue swUnitsLinear, swINCHES
Part.SetUserPreferenceIntegerValue swUnitsLinearDecimalPlaces, 3
Part.SetUserPreferenceIntegerValue swUnitsAngularDecimalPlaces, 2
Part.SetUserPreferenceIntegerValue swUnitsDualLinear, swCM
Part.SetUserPreferenceIntegerValue swUnitsDualLinearDecimalPlaces, 2
Part.SetUserPreferenceIntegerValue swUnitsMass, swKG <-------------
End Sub
ok
thanks in advance