×
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

Convert imperial units in metric macro

Convert imperial units in metric macro

Convert imperial units in metric macro

(OP)
Handleman gave a link to SWTools in a different thread and there was an engineering toolbox macro with different shapes in it.  

Angelsix LINK

Go to Products > Free Products > Solidworks > Engineering toolbox.

After running the macro, a dialog box pops up and all of the numbers in the drop-down field are metric.  It looks like this:  RHS screenshot LINK

It's easy enough to edit the macro to the sizes you want.  Here is snippet from the macro called "RHS"

CODE

Sub main()

Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc

' ##############################
' ####   SET EQUAL ANGLES   ####
' ##############################

MySizeValsString = ""

AddSizeValue "20x20x2"
AddSizeValue "20x20x2.5"

There are 9 macros in that library I can use (others are custom extrusions useless to me).  Is there a code snippet I can add to every macro so that it converts the metric input to imperial input?  Actually, not only the input but the sizes in the macro itself have to be in inches, such as the 20x20x2" shown in the code above.

Flores

RE: Convert imperial units in metric macro

Paul,
If Luke hangs out here, he's well disguised.  However, he does post relatively frequently on the SW forums, and he has forums on his own site.  He's pretty good about adding features to his code when asked.

-handleman, CSWP (The new, easy test)

RE: Convert imperial units in metric macro

(OP)
Thanks Handleman, I tried to register at his forum but couldn't so I emailed him instead.

Flores

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