- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Placing components with iMates, multiple positions
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:
The problem is that the torque arm can also be assembled on the other side of the gearbox:
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.
Or if this helped you, please, click (like)
Regards
Alan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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