Inventor 2019 iLogic constraints

Inventor 2019 iLogic constraints

DWhiteley
Advisor Advisor
1,100 Views
4 Replies
Message 1 of 5

Inventor 2019 iLogic constraints

DWhiteley
Advisor
Advisor

Using iLogic, can I use AddMate (contraints) to mate from a component to one of the Assembly workplanes?

 

Dave

Envisage

0 Likes
Accepted solutions (2)
1,101 Views
4 Replies
Replies (4)
Message 2 of 5

MjDeck
Autodesk
Autodesk
Accepted solution

Yes. To indicate that you want to use a work feature in the assembly itself, specify an empty string for the component name. Example:
Constraints.AddMate("Part1 XY Mate" "Part1:1", "XY Plane", "", "XY Plane")


Mike Deck
Software Developer
Autodesk, Inc.

Message 3 of 5

gcoombridge
Advisor
Advisor

Hi Mike,

 

How do you constrain to between parts of sub-assemblies? I want to constrain to subassemblies together using planes in a part that both assemblies have. Basically I just want to go one level deeper than this snippet.

 

I.e.:  "matename", "subassembly:1",  "part 1:1", "workplaneA", "subassembly:2",  "part 1:1", "workplaneA", 

 

is this possible?

 

Cheers,

 

Glenn

Use iLogic Copy? Please consider voting for this long overdue idea (not mine):https://forums.autodesk.com/t5/inventor-ideas/string-replace-for-ilogic-design-copy/idi-p/3821399
0 Likes
Message 4 of 5

MjDeck
Autodesk
Autodesk
Accepted solution

Hi Glenn,

Yes, it's possible. You can specify each full path {subassemblyName, ..., partName} to a component as an array of strings. The easiest way is to use brace characters to put the arrays together. Here's a sample:

Dim mate1 = Constraints.AddMate("matename", {"subassembly:1",  "part 1:1"}, "workplaneA", {"subassembly:2", "part 1:1"}, "workplaneA")

Note: if you have already created a constraint manually, you can see the code that would be required to re-create it by using the Capture Current State command on the context menu in the rule editor.


Mike Deck
Software Developer
Autodesk, Inc.

Message 5 of 5

gcoombridge
Advisor
Advisor

Brilliant! Thanks Mike

Use iLogic Copy? Please consider voting for this long overdue idea (not mine):https://forums.autodesk.com/t5/inventor-ideas/string-replace-for-ilogic-design-copy/idi-p/3821399
0 Likes