jmarkus
Mechanical
- Jul 11, 2001
- 377
I am using NX 2027 and by recording a journal to execute the "update mass properties" function, I have the resulting code:
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:
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
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