Message 1 of 2

Not applicable
08-21-2015
04:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey all,
Here is my code:
Dim oSheetMetalCompDef As SheetMetalComponentDefinition Set oSheetMetalCompDef = oDoc.ComponentDefinition Dim thick As Double thick = oSheetMetalCompDef.Thickness.Value / 2.54 thick = Round(thick, 3) thick = CStr(thick) If thick < 1 Then thick = Replace(thick, "0.", "") End If If thick = "25" Then thick = "250" ElseIf thick = "5" Then thick = "500" ElseIf thick = "75" Then thick = "750" ElseIf thick = "1" Then thick = "1.00" ElseIf thick = "1.5" Then thick = "1.50" ElseIf thick = "2" Then thick = "2.00" ElseIf thick = "2.5" Then thick = "2.50" End If
I would like for the sheet metal thicknesses to be rounded as they are above but I'm looking for an easier way to do it. For example I want thickness of 1/4 to return 250, 1/2 to return 500, 3/4 to return 750, 1 1/2 to return 1.50 and so on. Inventor seems to remove the trailing zeros when it gets the thickness so I am having difficulty adding them back in. Also, len(thick) returns 8 even when MsgBox thick returns "25", or "5", or any other thickness. Any help would be great.
Thanks,
Brendan Sullivan
Solved! Go to Solution.