Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Journal - NX9 - Part Attributes and Dimensionality (Units) 1

Status
Not open for further replies.

jmarkus

Mechanical
Jul 11, 2001
377
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
 
Replies continue below

Recommended for you

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
 
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
 
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
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor