I've had some problems trying to get the volume from the model to a variable into vba. I've found a way and it is like this:
Set swApp = Application.SldWorks
Dim instance As IMassProperty
Dim value As System.Double
value = instance.density
When I run the macro, Dim value As System.Double is highlighted and this error appears:
User-defined type not defined
I think I need to activate some references but I don't know exactly which one.
Check these example macros and use the codes as needed:
Get Mass Properties Example (VBA)
Get Mass Properties of Multibody Assembly Component Example (VBA)
Thank you very much. It works perfectly
Retrieving data ...