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"
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.
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"
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.






RE: Convert imperial units in metric macro
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
Flores