×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Issues changing secondary units with VBA

Issues changing secondary units with VBA

Issues changing secondary units with VBA

(OP)
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

RE: Issues changing secondary units with VBA

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

RE: Issues changing secondary units with VBA

(OP)
Regg,
Reference the type library .. that works great!

Thanks,
Killswitch

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources