×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Journal - NX9 - Part Attributes and Dimensionality (Units)

Journal - NX9 - Part Attributes and Dimensionality (Units)

Journal - NX9 - Part Attributes and Dimensionality (Units)

(OP)
Hi,

I've got a journal that will create a part attribute using:

CODE

workPart.SetUserAttribute(att, -1, 999.0, Update.Option.Now) 

where att is the ATtribuite Title, and 999.0 is just a placeholder to ensure I create a number-type attribute (e.g. not a string).

When I do this, I get a dimensionless/unitless attribute in the part properties, but ultimately I would like to be able to create mass, volume and area attributes with the correct dimensions via the journal.

Is there a simple way to do this with SetUserAttribute (or something similar), or do I have to use the AttributePropertiesBuilder method and go through all that?

Thanks,
Jeff

RE: Journal - NX9 - Part Attributes and Dimensionality (Units)

There is an overload of the .SetUserAttribute method that takes a variable of type NXObject.AttributInformation. This structure should allow you to specify the type of units.

If the above does not work, you'll probably need to use the attribute builder method.

www.nxjournaling.com

RE: Journal - NX9 - Part Attributes and Dimensionality (Units)

(OP)
Cowski,

I tried assigning the units to the the property Unit.Name for AttributeInformation but it looks like it is read only - or am I doing it wrong again?

CODE

Dim myAtt(9) As NXObject.AttributeInformation
...
myAtt(6).Unit.Name = "SquareMilliMeter"
workpart.SetUserAttribute(myAtt(6),Update.Option.Now) 

Jeff

RE: Journal - NX9 - Part Attributes and Dimensionality (Units)

Try this:

CODE

Dim attributeInfo As NXObject.AttributeInformation = Nothing

attributeInfo.Title = "TEST"
attributeInfo.Type = NXObject.AttributeType.Real
attributeInfo.RealValue = 2.718
attributeInfo.Unit = theSession.Parts.Work.UnitCollection.FindObject("SquareMilliMeter")

workPart.SetUserAttribute(attributeInfo, Update.Option.Now) 

www.nxjournaling.com

RE: Journal - NX9 - Part Attributes and Dimensionality (Units)

(OP)
Thanks Cowski,

Once again, I am stumped by the many ways that one can assign properties and values to NX 'things', but you have set me straight!

Jeff

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources