- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have been working on a project where I wanted user to pick pattern ,and enter the number of a element to suppress.
Here is my ilogic code for your help:
Imports Inventor
Dim doc As AssemblyDocument
doc = ThisApplication.ActiveDocument
' Attempt to pick an occurrence pattern
Dim selectedPattern As OccurrencePattern
selectedPattern = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrencePatternFilter, "Select a pattern")
If Not IsNothing(selectedPattern) Then
' Correctly reference the selected pattern
Dim oPattern As OccurrencePattern
oPattern = selectedPattern
' Get user input for the pattern element index
myparam = CInt(InputBox("Enter a value greater than 1", "Input", 2))
' Suppress the specified element in the pattern
If myparam > 0 And myparam <= oPattern.OccurrencePatternElements.Count Then
Dim oElement As OccurrencePatternElement
oElement = oPattern.OccurrencePatternElements.Item(myparam)
oElement.Suppressed = True
Else
MsgBox ("Invalid index. Please enter a value between 1 and ")
End If
Else
MsgBox ("No pattern selected.")
End If
Solved! Go to Solution.