Message 1 of 1
Turn off flat pattern sketch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Quick example of turning flat pattern sketches on/off. Attached file is an Inventor 2024 file.
ShowSketch1 = InputRadioBox("Choose sketch to show", "Sketch 1", "Sketch2", booleanParam, Title := "iLogic") ' a reference to the active document. Dim oPartDoc As PartDocument oPartDoc = ThisApplication.ActiveDocument 'verify document type is sheet metal If oPartDoc.ComponentDefinition.Type <> 150995200 Then MessageBox.Show("File is not a sheet metal part.", "iLogic") Exit Sub End If Dim oCompDef As SheetMetalComponentDefinition oCompDef = oPartDoc.ComponentDefinition ' Check to make sure a flat pattern is open. If Not TypeOf ThisApplication.ActiveEditObject Is FlatPattern Then Try If oCompDef.HasFlatPattern = False Then oCompDef.Unfold Else oCompDef.FlatPattern.Edit End If Catch MessageBox.Show("Error editing the flat pattern.", "iLogic") End Try End If ' a reference to the active flat pattern. Dim oFlatPattern As FlatPattern oFlatPattern = ThisApplication.ActiveEditObject oFlatPattern.Sketches.Item("FP Sketch1").Visible = ShowSketch1 oFlatPattern.Sketches.Item("FP Sketch2").Visible = not ShowSketch1