Placing components with iMates, multiple positions

Placing components with iMates, multiple positions

Daan_M
Collaborator Collaborator
233 Views
2 Replies
Message 1 of 3

Placing components with iMates, multiple positions

Daan_M
Collaborator
Collaborator

I'm trying to figure out a way to place components with multiple iMates with iLogic.

Right now i place the torque arm on the gearbox with a simple insert iMate defined within the partfiles using the following code in my assembly;

 

 

 

oACD.Occurrences.AddUsingiMates()

 

 

 

This works fine:

 

Daan_M_0-1697009382080.png

 

The problem is that the torque arm can also be assembled on the other side of the gearbox:

 

Daan_M_1-1697009838104.png

 

Is there any solution that allows me to define the placement side in iLogic?

 

For example maybe its possible I put 2 iMates in both the torque arm and gearbox parts (Left and Right side), and then i choose which one should be used in iLogic?

 

0 Likes
234 Views
2 Replies
Replies (2)
Message 2 of 3

A.Acheson
Mentor
Mentor

Hi @Daan_M 

If you look at this vba sample it will likely have what your looking for. You will need to look through your gearbox occurrence and find and select what definition you want to use. Knowing which index number might be enough for you. 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 3

m_baczewski
Advocate
Advocate

Yes, it's possible. You need to define the type and alignment of the iMate on the gearbox and the torque arm and update those constraints as needed:

Dim componentA = Components.Add("CZ11", "Your\Path\CZ11.ipt")

Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

Dim constrains As AssemblyConstraints
constrains = oDoc.ComponentDefinition.Constraints

For Each constrain In constrains
	constrain.Delete
Next

Select Case SIDE
Case = "LEFT"
	Constraints.AddByiMates("Left1", "CZ10", "W1", "CZ11", "W1")
	Constraints.AddByiMates("Left2", "CZ10", "W2", "CZ11", "W2")
Case = "RIGHT"
	Constraints.AddByiMates("Right1", "CZ10", "W3", "CZ11", "W3")
	Constraints.AddByiMates("Right2", "CZ10", "W4", "CZ11", "W4")
End Select

m_baczewski_0-1697784600630.pngm_baczewski_1-1697784605701.pngm_baczewski_2-1697784609372.png

 

 

0 Likes