Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

NX Journal - Accessing Mass(kg) column from Assembly Navigator after using MassCalculationBuilder

Status
Not open for further replies.

jmarkus

Mechanical
Joined
Jul 11, 2001
Messages
377
Location
CA
I am using NX 2027 and by recording a journal to execute the "update mass properties" function, I have the resulting code:

Code:
'Update mass values
Dim componenttags1(0) As NXOpen.NXObject
componenttags1(0) = workPart.ComponentAssembly
Dim massCalculationBuilder1 As NXOpen.Gateway.MassCalculationBuilder = Nothing
massCalculationBuilder1 = workPart.PropertiesManager.MassCollection.CreateCalculationBuilder(componenttags1)
nXObject1 = massCalculationBuilder1.Commit()
massCalculationBuilder1.Destroy()

After this code executes, there is a user attribute in each lowest level component called "MassPropMass" which contains the mass value which is reported by the Assembly Navigator. I can access this value by using:

Code:
MASS = child.GetUserAttribute("MassPropMass", NXObject.AttributeType.Real, 0)

However, if the component is itself an assembly then it seems that this attribute is not populated (doesn't show up in RMB Properties->Attributes) - even though it is listed when I turn on the mass properties panel.

Is there a way I can access this value using NXOpen? I know there are other methods such as using 'ufs.weight.EstabCompProps1' but that seems to take longer to update when I execute it (especially with large assemblies) vs the method above.

Thanks,
Jeff
 
Thanks cowski,

I was looking at that after I posted the question. I learned that MassPropMass and MassPropRollupMass are attributes that can be toggled on to be 'automatically' created in the customer defaults and we only had the first one toggled on. That should work.

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top