Submitted by TechGee on Tue, 08/29/2017 - 00:53
Forums:
Hello Everyone,
I am trying to create a program that can read the attributes of a part. Meaning the standard attributes that are displayed in the properties of a part.
Is there a method I can use or is it a method for each attribute specifically?
Thanks in advance :)
re: get attributes
The .GetUserAttributes method will return all the attributes for an object. This would be a quick way to get all of the part attributes.
Thanks! This was exactly what
Thanks! This was exactly what I needed :)
Is there also a way to get the modeller type of the part and the version of NX, which was used to save the part?
re: version of NX
The NXOpen API has a method named .AskPartHistory; I'm fairly certain that you can extract the NX version of the part from the information that it returns. Alternatively, there is a command line utility that ships with NX called: ug_inspect.exe. If you call this utility with the -release parameter, it will return the version of UG/NX that the file was last saved in. You'd need to do some parsing of the output to find the version information, but it is another way to get the NX part file version.
I'm not sure what you mean by the "modeller type of part", can you elaborate on what you are looking for here?