Get user attribute information of a part | Get title and its value | NX Open Automation | AttributeInformation

An attribute is a persistant way to store non-geometric data (i.e. not a point or curve or solid or feature).

Attributes can be referenced in expressions and (in drafting) in notes/labels/other drafting text (including parts lists, etc.)

 

The journal cycle through the work part and display all user attributes in a listing window.

Imports System
Imports NXOpen
Imports NXOpen.UF

Module NXJournal
Sub Main(ByVal args() As String)

Dim theSession As Session = Session.GetSession()
Dim theUI As UI = UI.GetUI()
Dim workPart As NXOpen.Part = theSession.Parts.Work
Dim theUfSession As UFSession = UFSession.GetUFSession()
Dim lw As ListingWindow = theSession.ListingWindow
Dim filename As String = "F:\PlateWithHoles.prt"
lw.Open()
Dim attr() As NXObject.AttributeInformation = workPart.GetUserAttributes()

For Each attr1 As NXObject.AttributeInformation In attr
lw.WriteLine(attr1.Title)

Try
lw.WriteLine(attr1.StringValue)
Catch ex As Exception

End Try
Next
End Sub
End Module

API Information:
Class NXObject.AttributeInformation contains attribute information.
 
 

Social Connect

Learn CAD Automation using NX Open & Automate Design Tasks in Less Than 90 Days Without Any Prior Knowledge.

Attend the NX Open Masterclass to Discover

What’s Popular

Browse Popular, evergreen tutorials and how-to guides.

This journal get’s the name material used in part. Imports SystemImports NXOpenModule NXJournalSub Main (ByVal args() As String)Dim theSession As NXOpen.Session = …

This journal get’s the name material used in part. Imports SystemImports NXOpenModule NXJournalSub Main (ByVal args() As String)Dim theSession As NXOpen.Session = …

Datum Planes are a planar reference feature to help define other features, such as swept bodies and features at angles to the …

The use of computer-aided design (CAD) software has become an essential tool in engineering and manufacturing. There is no industry today that …

An attribute is a persistant way to store non-geometric data (i.e. not a point or curve or solid or feature). Attributes can …

An attribute is a persistant way to store non-geometric data (i.e. not a point or curve or solid or feature). Attributes can …

Design Engineers always spend more time on drawings for several reasons. A few of them are; Drawings are prime source of information …

It is quite possible to create a blank part and drawing sheet with one click of a button. Yes, you are right, …

NX Open is a powerful tool for automating NX CAD tasks. Below is source code that creates a new blank prt file …

As engineers and designers, we often have to work with complex 3D models and drawings, and extracting important information from these can …

NX Open is a powerful tool for working with imported geometries in NX.One common task that engineers and designers may need to …

https://youtu.be/5NWHlSM0sQ0 Q:Can you teach me nx open using visual basic .net? ChatGPT: Yes, I can help you get started with using Visual …