Message 1 of 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a iLogic code here (See below), that I copied from on one of the forums here, for creating flat patterns from a sheet metal part template. It is working great in automatically generating a flat pattern but is there a way to update/add in the code to delete the old flat pattern and create a new one? Or Over write the other flat pattern. The reason for this is that under the code I have linked the Custom iProperties Value to the drawing. Meaning the bounding box of the flat pattern (i.e. Height and Width) are linked with the parts list. Maybe someone can help me with this. Thank you.
On Error Resume Next Dim oDoc = ThisApplication.ActiveDocument 'CHECK FILE TYPE If oDoc.DocumentType <> kPartDocumentObject Then Return End If Dim oCompDef As SheetMetalComponentDefinition oCompDef = oDoc.ComponentDefinition oDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" If oCompDef.HasFlatPattern Then Return Else 'CREATE FLAT PATTERN IF DOESN'T EXIST If oCompDef.Type = 150995200 ThisApplication.ScreenUpdating = False oCompDef.Unfold() ThisApplication.ScreenUpdating = True 'oDoc.ComponentDefinition.FlatPattern.Edit() oCompDef.FlatPattern.ExitEdit End If End If Dim extents_length As String = SheetMetal.FlatExtentsLength Dim extents_width As String = SheetMetal.FlatExtentsWidth iProperties.Value("Custom", "Height") = extents_length iProperties.Value("Custom", "Width") = extents_width
Solved! Go to Solution.