Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Wrapper methods for UF in "uf_attr.h"

Status
Not open for further replies.

lklo

Industrial
Joined
Nov 24, 2010
Messages
226
Location
DK
Hi -

I'm doing some NXOpen API programming VB and often use some of the "Wrapper methods" for NXOpen.UF

But in the file: uf_attr.h it seems that there are some (many) calls that is not possible to use as VB, because there is no wrapper method.
---
ex. Not working:
UF_ATTR_ask_part_attrs_in_file > cant find wrapper method
UF_ATTR_read_value > cant find wrapper method
UF_ATTR_ask_part_attrs > cant find wrapper method

---
ex. Working:
UF_ATTR_ask_part_attribute > ufs.Attr.AskPartAttribute()
UF_ATTR_find_attribute > ufs.Attr.FindAttribute()

My question is :

Will it be possible to use all the calls from the uf_attr.h in a VB program - and if so - how do I do this?

lklo
 
The NXOpen API does not fully cover the C/C++ API. Some of the functions you mention have a note "Discouraged in new applications"; these were probably intentionally left out of the NXOpen API. Two of the examples you gave have NXOpen equivalents (no wrapper function needed):
UF_ATTR_ask_part_attrs > {part reference}.GetUserAttributes(...)
UF_ATTR_read_value > {part/object ref}.GetStringUserAttribute | .GetNumberUserAttribute | .GetTimeUserAttribute | etc etc

The UF_ATTR_ask_part_attrs_in_file function looks interesting and a quick scan of the NXOpen docs found no equivalent. Sometimes wrapper functions are not added to the NXOpen API because the data returned by the C/C++ function is not easily converted to the managed .net environment (such is the case with some of the UF_BREP functions). Though I'm not sure this is the case for UF_ATTR_ask_part_attrs_in_file. A call to GTAC would probably be required for a definitive answer.

www.nxjournaling.com
 
I already did that for UF_ATTR_ask_part_attrs_in_file. PR's open, an NXOpen replacement is planned, but not implemented yet. Additional info on these UF_ATTR changes can be found in SFB-NX-6866 and SFB-NX-6874.
 
Hi

Thank you for your answer. I do know that some of the examples doesnt need a wrapper, I know the ****.GetUserAttributes() very well.
But in my current programming project, I'm doing some test to read attributes from NX files placed into a windows file folder(7000+ nx part files as assembly).
My intention was, if it was possible to do this without opening each file, but I dont thing it is possible.
What I have made until now is also working very well.
I have put all files into an array ,aftewards I open each file quite ,and make it workpart quitely temporary, also without making it display.
In this manner it possible to read the partattributes im each file very fast - without have any parts displayed , (only No Part in the NX window)
Another important thing is - when higspeed reading is nesseary - is to set the "SetUpdateLock(True)" from within the Class updatemaneger.

lklo

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top