Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Repair broken assembly constraint

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Bert_Bimmel
233 Views, 4 Replies

Repair broken assembly constraint

Hello Everybody,

 

in Inventor you can replace an occurrence by another part of different origin. Usually, the constraints will break, as Inventor cannot find the corresponding geometry at the new part:

Bert_Bimmel_0-1710761300931.png

You can then repair that constraint in the GUI by telling Inventor which geometry it shall take on the new part instead by picking it in the graphics window:

Bert_Bimmel_1-1710761377906.png

 

So far so good.

Now i would like to repair my constraint via API. Apparently this seems not possible, as the entityX-property of my constraint is read only:

 

Bert_Bimmel_2-1710761484472.png

Do I really have to recreate that constraint completely and delete the old one?

 

This is quite unsatisfactory!

 

 

4 REPLIES 4
Message 2 of 5

I offer you another way, why don't you use the main planes, main axes to make the restriction? For example, if you have a part file and its constraints are referenced with the main plans, when replacing it with another part file the constraints will not fail. When it comes to faces of solid bodies, these will always fail because each face will be identified with a unique name. The new problem you will have in this way is that your constraints will fail if you replace a part with a subassembly. But I have another solution, place 3 constraints between main planes for part and 3 constraints between main planes for assembly, depending on what type of file it is (part or assembly) you will activate and deactivate the constraints you need.
Another way is through imates. I tried it once but at that time it gave me problems in specific situations so I followed the way that I have detailed.


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

Message 3 of 5

I don't use OriginWorkplanes because placing a screw in a hole with your method instead of an InsertConstraint is pretty cumbersome. 😉

Message 4 of 5

I don't see it as cumbersome, in the case of a screw, there are only 2 constraints. Workplane with face and axis with axis. In any case, I hope you find a simple solution, many times it is about simplifying and avoiding paths that lead to errors in automation. Big hug colleague!


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

Message 5 of 5

Ok, and now I do not exchange the screw, but the plate with the hole instead, and inventor does'nt find the corresponding hole again?
But I found the answer to my question myself:
Just convert your MateConstraint to a MateConstraint...

Bert_Bimmel_0-1710765304109.png

... and you can redefine the geometry to use completely without having to delete and recreate it

 

Who's supposed to come up with this workflow?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report