Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

How to retrieve Created and Modified time of features in the part navigator using NXOpen ? 1

Status
Not open for further replies.

biw01

Automotive
Dec 31, 2011
152
Hello Everyone ,

Can someone help me out with a sample code on how i can retrieve the created and modified time of all the features in the part navigator using NXOpen in NX 7.5?

Thanks and Regards,
Amitabh
 
Replies continue below

Recommended for you

At best, the only data stored with a feature is the Date (but not the actual time) that the part was saved which contained the newly created feature as well as the Date (again, not the actual time) that the part was last saved after a modification to a feature took place. While I don't have to exact details on how that data can be extracted from a part file using NX Open, this will be the best that you can do no matter what.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
Thanks John.
Well in that case i am interested in knowing as to how i can retrieve the modified and the created date using NXopen of all the features in the part navigator.

Regards,
Amitabh
 
Hi

Don't know if you can get the that information directly, but you can use the "theSession.information.displayfeatureinformation()
method and redirect the information window output silently to a temporary file that you then read, parse and delete.

 
It is possible to do this in two steps.

1. Use a NXOpen function or the equivalent wrapper function to get the part history creation version number and last modified version number for the object

int UF_OBJ_ask_cre_mod_versions
(

tag_t object,
int * creation_version,
int * lastmod_version

)

2. Use the part history to get the dates and time.

int UF_PART_ask_nth_history
(

UF_PART_history_list_p_t history_list,
int index,
char * * program,
char * * user,
char * * machine,
int * version,
int * gmtime

)

Frank Swinkels
 
Thanks Franks , I will try this out and consult you in case i need more clarifications.

Regards,
Amitabh
 
Frank ,

I implemented the wrapper functions as mentioned by you.
But the second wrapper function gives the part history and not the feature history ehich i am actually interested in, can you let me know how can i get the feature history (of all the features in the part navigator)

Regards.
Amitabh
 
It is correct that the second function give the part history however the first function gives the part creation and last modified version for the particular feature. The code logic is something like this.

For each feature in work part call UF_OBJ_ask_cre_mod_versions
This will return the creation_version (ie the part version when the feature was created)
and return the lastmod_version (ie the part version when the feature was last modified)
Now call UF_PART_history_list_p_t history_list and use creation_version to get gmtime for the
feature creation and call UF_PART_history_list_p_t history list and use lastmod_version to gmtime for the feature last modified.

Hope this helps.

Frank Swinkels
 
Thank you Frank.
This really helped and i am able to get what i had ventured out for.

By the way Wish you a Very Happy New Year.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor