Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good day Everyone!
I have a code here in iLogic that would create a flat pattern on a sheet metal part once it is saved. This works great and when I create a drawing for the part and I place the flat pattern view in the drawing it shows perfectly in the drawing. The problem now is that when I modify the part or just re-saving it again, it deletes the flat pattern view in the drawing. I don't know if my code is incorrect, do I have to specify base face all the time or is it an inventor issue. (See code below)
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}" '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 Dim extents_length As String = Round(SheetMetal.FlatExtentsLength, 3) Dim extents_width As String = Round(SheetMetal.FlatExtentsWidth, 3) iProperties.Value("Custom", "Height") = extents_length iProperties.Value("Custom", "Width") = extents_width
Solved! Go to Solution.