Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

NXOpen Face Tags: save and call 2

Status
Not open for further replies.

Frank2288

Mechanical
Nov 20, 2015
38
0
0
IT
Hi! Another question (I guess you are all hating me at this point, with all these questions)..

I built a tool to select a few faces from a part (let's call it example.prt) and to save the Nxopen.face.tag of the selected faces in a txt file.
My idea was to use this file and the TAG contained in it to import the information about the selected faces in a new istance of NX, where i open the same example.prt and call the corresponding faces without the need to redo the whole user selection.

I found out that this method doesn't work because it appears that the TAG change whenever i open for the second time the part. As you can see in the image, on the left there is the list of TAGs of all the faces of the part example.prt (I obtained it using body.getfaces), on the right there is the list of TAGs of the faces that i selected the first time. As you can see there is no correspondance between the two lists. Of course, the part has not been modified, but only closed and re-opened.

Am I doing something wrong or this is normal? Is there a way to save a selection of faces with a more convenient approach?


tag_diverse_gakode.jpg


Thank you.
 
Replies continue below

Recommended for you

Tags do not persist between sessions; handles do.
Alternately, if you only have a few faces to process, you could give each face a custom name or attribute and look for the same name or attribute on subsequent runs of your program.

www.nxjournaling.com
 
Once you have an object's tag, you can use the .AskHandleOfTag method to get the handle. When you have the handle, you can use .AskTagOfHandle to get the tag of the object in the current session (if it exists).

www.nxjournaling.com
 
Status
Not open for further replies.
Back
Top