Is there a way to get the density for part files? GetPhysicalProperties method seems to work but it is NOT!
It will return the 'Up-to-date' results only if ComputePhysicalProperties are called firstly. Unfounately, ComputePhysicalProperties method takes density as its input (stupid design I think).
Does anyone have a possible solution? Please shed some light...
Thanks in advance!
Solved! Go to Solution.
I get the density from the variable table:
objDimQuery = ObjDoc.Variables.Query("PhysicalProperties_Density")
density = objDimQuery.Item(1).value
you can also use the method GetGlobalParameter of the PartDocument object:
The call of GetPhysicalProperties() will return the density also, but there must be a valid body, a material or at least the density must be assigned and the physical property must have be calculated before.
Check the Status parameter after calling GetPhysicalProperties()