Easy way to constrain to iMate in Assembly

Easy way to constrain to iMate in Assembly

amichaudJ6E3R
Contributor Contributor
773 Views
3 Replies
Message 1 of 4

Easy way to constrain to iMate in Assembly

amichaudJ6E3R
Contributor
Contributor

Hi, so I've used this a lot in the past, but from a part to another part inside an assembly.

 

 

 

Constraints.AddByiMates("Mate1", "Part1:1", "iMate:1", "Part2:1", "iMate:1")

 

 

 

Now, this is fairly simple and I like it. I've looked online and all I could find were paragraphs of VB code that are way too much for what I want.

I created an iMate in my assembly (connected to the origin XZ Plane) and I am trying to constrain, using the line above, a part's iMate to this assembly iMate. Is that possible?

 

Something like

 

 

 

 

Constraints.AddByiMates("Mate1", "Part1:1", "iMate:1", ThisAssembly, "iMate:1")

 

 

 

 

 

Thank you 🙂

 

-A

0 Likes
Accepted solutions (1)
774 Views
3 Replies
Replies (3)
Message 2 of 4

JhoelForshav
Mentor
Mentor
Accepted solution

Hi @amichaudJ6E3R 

Can you do this manually with the UI? I've tried it and I can't get the create an iMate result between an iMate in the main assembly and an iMate in an occurrence... So I don't think it works at all...

 

I'd suggest using AddByiMateAndEntity instead. Generally with these Constraints.Add - methods in iLogic, if you want to use something from the top assembly it's component argument is an empty string (""). So this will work for example:

 

Constraints.AddByiMateAndEntity("MateName", "Part1:1", "iMate:1", "", "XZ Plane")

 

Message 3 of 4

amichaudJ6E3R
Contributor
Contributor

@JhoelForshav  - Thanks for the reply. I am ashamed to say that I did not try to do it manually, it seemed so trivial.

 

I will try the add by entity, I knew I could probably use something like this, but I never did in the past and couldn't find the proper syntax to call the root assembly and the plane. But you just enlighten my day, thank you for your help

0 Likes
Message 4 of 4

amichaudJ6E3R
Contributor
Contributor

AAAAND it works. Exactly like I wanted to. Thanks a lot for your help. @JhoelForshav 

0 Likes