Hello,
I use DocumentManager to the mass from all configurations:
2017 SOLIDWORKS API Help - GetMassProperties Method (ISwDMConfiguration)
Sometimes I get a swDmMassPropErrorNoData-error for a configuration. When I open the file in SWX, change to this configuration and use swModel.Extension.GetMassProperties, I get the mass.
Does anyone can guess a reason, why DM is sometimes not working?
Thanks,
Samuel
Apparently GetMassProperties only retrieves a cached result created by the mass calculation that happens inside SOLIDWORKS so that sholud explain why it is. You need to open the part, calculate the mass, save it and then use the DM again. Mass calculation involves reading the part's bodies. I'm not sure the document manager is designed to do that.
Let me know if this helps.
Cheers,
Amen
CADHERO consulting SUARL – SOLIDWORKS API/PDM Design Automation & Training – SOLIDWORKS VBA MACROS, SOLIDWORKS Addins an…