How to save constraint for replication in other assembly with same parts

How to save constraint for replication in other assembly with same parts

PanWauu
Contributor Contributor
264 Views
2 Replies
Message 1 of 3

How to save constraint for replication in other assembly with same parts

PanWauu
Contributor
Contributor

Hi everyone,

 

I want to save a constraint between two parts/assemblies in oder to replicate this constraint in another assembly containing the same parts in the future.

 

Up to now, I did it by saving the transientkey of both entities (eg planes of the parts) and the constraint parameters (offset, ...). To insert the constraint again I just bind the entities from the surface body and create the constraint.

 

Now with assemblies and nested assemblies it gets more complicated because there is not only one surface body. Also I need to implement a lot of edge cases to cover all constraint types. Do you have any other ideas?

- One idea of mine was to just "save" the complete object of the constraint and load it again, exchange to references to the correct occurences and add it to the assembly. Not sure if it is possible to save it.

- Another idea was to resolve the way to the surface body. Either by indexing them somehow or by using the name of the surface body. Sadly there can be two surface bodies with the same name in nested assemblies. 

- Also i tried using references instead of transientkeys but I was not able to make it work with C#

 

Thanks for all ideas!

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

WCrihfield
Mentor
Mentor

What you are describing sounds pretty complicated.  But when the subject includes 'constraint replication' or 'saving/reusing constraints', the first thing that comes to mind is 'iMates'.  Have you ever looked into implementing/including iMates into your assembly automation routines?  They are essentially like half of a constraint that you can define in the component file, and when you place the component into an assembly where other components have matching iMates, the two halves of the constraint (iMates) will sort of constrain themselves together for you.  I never used them that much myself, due to various circumstances, but they are a great tool that you may want to familiarize yourself with...if you are not already familiar with them.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

PanWauu
Contributor
Contributor
Thanks alot for your suggestion!
Sadly, I cannot change or save any of the included parts. Therefore the insertion of iMates is no option.
0 Likes