ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
AAAmanda Armudi13/11/2018

I am trying to write a macro to show the mass of a part in the properties... However as you guys can see in the pic it is not working, because my macro is not getting the right value. I think I need the right path to copy the mass from the solidworks, I don´t really know. If someone could help me, it would be great.. THANK YOUUU

Sub main()

Set swApp = Application.SldWorks

Set swModel = swApp.ActiveDoc

End Sub

Dim MyMassProp As Double

retval(35) = swModel.DeleteCustomInfo2(property, "mass")

retval(35) = swModel.AddCustomInfo3(property, "mass", swCustomInfoText, MyMassProp) 2018-11-13_12h05_21.png