Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Issues changing secondary units with VBA

Status
Not open for further replies.

killswitch

Mechanical
Jul 28, 2003
39
I'm looking for the swConst value for swUnitsDualLinear so I can change the secondary units :

retval = Doc.SetUserPreferenceIntegerValue(swUnitsDualLinear, swMM)

I've successfully used the following to change the primary units (type and precision) and the secondary precision:

Const swUnitsLinear = 47
Const swUnitsLinearDecimalDisplay = 48
Const swUnitsLinearDecimalPlaces = 49
Const swMM = 0
Const swINCHES = 3
Const swDetailingAltLinearDimPrecision = 26
..
retval = Doc.SetUserPreferenceIntegerValue(swUnitsLinear, swINCHES)
retval = Doc.SetUserPreferenceIntegerValue(swUnitsLinearDecimalPlaces, 3)
retval = Doc.SetUserPreferenceIntegerValue(swDetailingAltLinearDimPrecision, 2)

Thanks,
Killswitch
 
Replies continue below

Recommended for you

The answer is 254. The question to you is why do you not just set either VB or VBA references to look at the SolidWorks 200x Constant type library? That way you would not have to create the constants.

Regards,

Regg

 
Regg,
Reference the type library .. that works great!

Thanks,
Killswitch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor