Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Convert imperial units in metric macro

Status
Not open for further replies.

smcadman

Mechanical
Nov 6, 2002
1,589
US
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
 
Replies continue below

Recommended for you

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)
 
Thanks Handleman, I tried to register at his forum but couldn't so I emailed him instead.

Flores
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top