Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to put the extents from a sheet metal part in a Parameter.
Sub Main() 'Determines if there is a flat pattern Dim oDoc As PartDocument oDoc = ThisDoc.Document 'ensure this part has a flat pattern Dim oSMDef As SheetMetalComponentDefinition oSMDef = oDoc.ComponentDefinition If oSMDef.FlatPattern Is Nothing Then 'Warns the user there is no flat pattern 'MessageBox.Show("This file has no flat pattern", "iLogic") Else Extents End If End Sub Sub Extents() extents_length = SheetMetal.FlatExtentsLength extents_width = SheetMetal.FlatExtentsWidth LengthFrac = Round(SheetMetal.FlatExtentsLength, 1) WidthFrac = Round(SheetMetal.FlatExtentsWidth, 1) Dim oValue As String Dim param As Parameter If extents_width < extents_length Then oValue = ("FP " & WidthFrac & "x" & LengthFrac &"x" & Parameter("Thickness") & "mm") param=param.AddByValue("DIMENSIONS", (oValue) , "text") Else oValue = ("FP " & LengthFrac & "x" & WidthFrac &"x" & Parameter("Thickness") & "mm") param=param.AddByValue("DIMENSIONS", (oValue) , "text") End If End Sub
I'm close but I can't figure out how to actually make the parameter.
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
___________________________Solved! Go to Solution.