ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
CTChristopher Thorn21/07/2008
Hi all, thanks for taking the time to help.

I am using a macro to save custom properties into my Part files (drawing number, material of construction, finish, etc) which is then transferred to the title block in the component's Drawing document. One of the custom properties is "SW-Mass", which always seems to evaluate to 3 decimal places (conincidentally or otherwise this is what I have my dimension rounding set to).

Is there a way I can round this number to a specified number of decimal places (usually none) before it is written to the Drawing title block?

If I invoke the custom property userform with a Part document open, any previously saved custom properties are pre-filled in on the form, apart from the weight of the component. I have just tried using the following code in UserForm_Initialize() to get the weight to be filled into a text box...

txtWeight = ModelDoc2.CustomInfo("Weight")

... but it simpy displays "SW-Mass" in the textbox as opposed to the evaluated value. How can I get the evaluated value to display in the textbox?

Many thanks,

Chris