08-14-2024
12:02 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-14-2024
12:02 PM
I want to use ilogic to select two parts or subassemblies in a top level assembly and have the imates that i have entered in each automatically connect. I am new to ilogic and i am not sure this can be done
Solved! Go to Solution.
08-14-2024
02:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-14-2024
02:14 PM
@X2RESTON, here is a quick example, where both selected components have an iMate named "iMate2"
oSet = ThisApplication.ActiveDocument.CreateHighlightSet oMsg = "Select 1st (press ESC to continue)" Dim oOcc1 As ComponentOccurrence = ThisApplication.CommandManager.Pick _ (SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, oMsg) ' If nothing gets selected then exit If IsNothing(oOcc1) Then Exit Sub oSet.AddItem(oOcc1) oMsg = "Select 2nd part (press ESC to continue)" Dim oOcc2 As ComponentOccurrence = ThisApplication.CommandManager.Pick _ (SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, oMsg) ' If nothing gets selected then exit If IsNothing(oOcc2) Then Exit Sub oSet.AddItem(oOcc2) Constraints.AddByiMates("", oOcc1.Name,"iMate2", oOcc2.Name, "iMate2") oSet.Clear