Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Connecting parts with imates by selecting the parts that i want to connect while using ilogic

X2RESTON
Explorer

Connecting parts with imates by selecting the parts that i want to connect while using ilogic

X2RESTON
Explorer
Explorer

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

0 Likes
Reply
Accepted solutions (1)
159 Views
1 Reply
Reply (1)

Curtis_Waguespack
Consultant
Consultant
Accepted solution

@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

 

0 Likes