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

iLogic - Toggle Constraining, Occurance Numbers/Names

Greetings,

 

What I'm trying to build in Inventor 2019; New Toys so experimenting :slightly_smiling_face:

In an assembly enviroment, add 2 different parts, each part has named surfaces 1, 2, 3 for example

Run a Form to Select Part A & Select Part B

Snap Surface 1 from Part A to Surface 1 from Part B

Click again on Part A Then Snap Part B To Surface 2 on Part A

Reverse for Part B

 

The problem I'm running into atm is, since I want to make this a "General" tool

(So having multiple instances of Part A & Part B)

Are the occurance numbers on the parts, how to transfer those along the code

 

More specificly how to move from the Selected "Object" to a "String"

Since the Occurance Name does not have an iProperty value, which is annoying

 

Some Crude Unfinished Code:

SyntaxEditor Code Snippet

Dim Object_A As Object
Dim Object_B As Object

Dim Orientation_A As Integer
Dim Orientation_B As Integer

ThisAssembly.BeginManage("Group 1")
' Section To Add Required Parts/Assembly's ... ' Select The Primary & Secondary Snap Parts Object_A = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, "Select The First Component") Object_B = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, "Select The Second Component") ' Code To Get The Selected Object Into 2 Seperate Strings ' ... ' Loop Trough Each Availible Socket Orientation_A = "1" Orientation_B = "1" ' ... ' Create Named Surface To Named Surface Constraints 'Constraints.AddMate("Mate:1", Object_A, Orientation_A, Object_B, Orientation_B) Constraints.AddMate("Mate:1", "Testblok 2:1", Orientation_A, "Testblok 1:1", Orientation_B) ThisAssembly.EndManage("Group 1") RuleParametersOutput() InventorVb.DocumentUpdate() iLogicVb.UpdateWhenDone = True

  Anyone who has some suggestions on how to do this? :slightly_smiling_face:

 

Kind Regards,

NVD