How to Read Attributes in Nx Open Programming |attach attributes to any NX object store information
HTML-код
- Опубликовано: 18 сен 2022
- How to Read Attributes in Nx Open Programming |attach attributes to any NX object store information
cycles through the bodies in the work part, and prints all the attributes on each body to the
Information window. Attributes can be defined to be certain types, such as Integer, Number, Time, and String, but
you will always be able to get a string representation of the attribute through the StringValue property.
Dim theSession = Session.GetSession()
Guide.InfoWriteLine("Outputting list of attributes in each body in the work part:")
Dim bodies = theSession.Parts.Work.Bodies
For Each bod As body in bodies
Dim attributes = bod.GetUserAttributes()
For Each attr As NXObject.AttributeInformation in attributes
Guide.InfoWriteLine(attr.Title & " = " & attr.StringValue)
Next attr
Next bod
Guide.InfoWriteLine("")