Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

NX Modeling - Replace component break constraint

Status
Not open for further replies.

Suncad

Mechanical
Oct 30, 2013
44
Hi all,

When I try to replace a component from the assembly by the same component "saved as" with new name, and with "retain relation" checked, the component gets replaced and both of its relations (contact csys over csys) are effectively retained.
When I try to do the same with a component exactly build like the original, one of the constraints (still CSYS over CSYS) is broken.
I thought the UID was the problem, but even if I set UID of the new component to match the original, it still break the constraint while replacing.

The parts are generated with a vb macro, so they really are the same.

Any idea why this behavior ? Is there another hidden UID attribute ?
Thanks for any help

Sun
NX12
EDIT : I'm not sure I put this topic in the right section :/ pardon me.
 
Replies continue below

Recommended for you

If the new component is copied from the original component then the constraints will be retained when "replaced".
But simply making a component just like another component does retain the constraints.
I can explain why that is, and I will try to do that when I have more time, or if I can find some good links for you.

Jerry J.
UGV5-NX1884
 
Thanks for your reply.

I'm a bit confused though. The two parts I try to swap are build using a script and nothing else. So, except UID and windows file attributes (such as "last modified date"), how can NX distinguish the part from its "clone" ? If you have any documentation on this I would highly appreciate, this is quite an issue considering what I need to achieve.

Sun
 
Suncad said:
...but even if I set UID of the new component to match the original...

I'm curious what you are doing to accomplish this. To the best of my knowledge, the part UID is set by NX and cannot be changed by the user.

www.nxjournaling.com
 
Hi cowski,

I want to build skeleton parts (3dline, CSYS, 3DArcs and so) and assembly them based on Excel worksheet and some input parameters. I have made most of the work, everything is building up perfectly, except I cannot rebuild a specific part with a part of the excel file and use it to replace a specific component.

cowski said:
To the best of my knowledge, the part UID is set by NX and cannot be changed by the user.

Yes it can be changed, unlike in CATIA, it can be both get or set. I have run tests to ensure it does.
 
Ok, finally after investigating further, and according to the documentation, renaming object can help keeping constraints when using "replace component".
Although I knew this and had my CSYS features used for constraints renamed, I did not use the name attribute of the object itself (instead of the feature). When I rename the CYS object in both parts, I am able to swap them and keep constraints.

Thanks for your time.
Sun
 
Suncad said:
Yes it can be changed, unlike in CATIA, it can be both get or set. I have run tests to ensure it does.

What procedure do you follow to change the UID? I'm curious as it may come in handy for some of my projects.

www.nxjournaling.com
 
Simple as that :
Code:
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim old_id As String = workPart.UniqueIdentifier

Dim new_id As String = "this is the new id"
workPart.UniqueIdentifier = new_id
theSession.ListingWindow.WriteLine(workPart.Name & " old id was " & old_id)
theSession.ListingWindow.WriteLine(workPart.Name & " new id is " & workPart.UniqueIdentifier)
theSession.ListingWindow.Open()
 
I too are very curious on how you proceed to change the UID. To my knowledge this should not be possible.

anyhow, the trick to keep constraints when replacing components is to apply the same name to corresponding faces. ( Not features but faces, edges, curves, points, datums etc, - topological objects.)

assume you have a "align" constraint between two faces. Make the component to be replaced the work part , then select the face used for the constraint, RMB- Properties -> General tab - Name;
enter a logical name then OK. ( no "Add index to name")

In the part that should be swapped in, repeat and assign exactly the same name to the corresponding face.
This will make the assembly constraints find the corresponding object when replacing the components.

Regards,
Tomas




 
Thanks Tomas,

Yeah, I found out the name trick, but my parts are essentially non-volumetric, only lines, arcs and CSYS. Except CSYS (and vectors planes and origins), 3Dlines and 3Darcs do not have a name property assigned to the object itself, so this not possible to keep constraints except the ones attached to CSYS (in my case).

For such objects (lines and arcs), NX seems to use a flag index for almost every operation (features, featuresbuilders, objects etc.) so the objects themselves have sort of random index, which is somewhat similar to part UID but for objects. This index (flag) is the thing NX seem to use to reconnect the dots when replacing component. Unfortunately whereas the part UID is read/write, the objects flag is read only. Therefore it is not possible to build identical parts, since the flag index is different every time, and that is why I've come to think this is a software limitation.

The only think I could think of is an smart macro that would scan objects name to reconnect broken constraints, but that would be quite a piece of work that I cannot afford to spend time on.

Sun
Ps : workPart.UniqueIdentifier is read/write property
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor