Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Status
Not open for further replies.

jmarkus

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

Recommended for you

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.
Back
Top