Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng 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
Joined
Jul 28, 2003
Messages
39
Location
CA
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
 
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

Back
Top