Automatic Unit Conversion in SOLIDWORKS File Properties

Article by Miguel de Villa on Sep 10, 2025

Mass Properties are one of the easiest tools to use inside SOLIDWORKS models. They are easy to review with the Mass Properties command, easy to link to a custom property for BOMs and drawings, and they also update automatically as model geometry and material change.

SOLIDWORKS 2024 and newer versions allow users to easily add unit notations to any custom property. Here, the weight of the part has “g” added to denote the measurement is in grams as per the document’s unit system of MMGS.

SOLIDWORKS 2024 and Newer Add a Unit Notation to a Custom Property

Even better, the unit notation automatically switches over when the unit system is changed. Seen below, weight is automatically converted to its equivalent value and notation in pounds when the unit system is switched from MMGS to IPS.

SOLIDWORKS 2024 and Newer Unit Conversion for a Custom Property

However, in SOLIDWORKS 2023 and older, while the value of a mass property can be calculated and updated, the unit notation is not. This blog describes a workaround for displaying and converting mass properties automatically, with appropriate units displayed. These behaviors will then be codified using SOLIDWORKS Equations into a document template so that it’s easy to use and deploy across multiple documents in the future. Arithmetic conversions of units are accomplished using Equations in the Equations Manager, as a custom property cannot evaluate an arithmetic expression with text at the end.

Shown are examples of the completed syntax implemented in a document template that has its default unit system set to MMGS and outputs custom properties that display the equivalent weight in grams(g), kilograms(kg), and pounds(lb) whenever the model is rebuilt in SOLIDWORKS.

SOLIDWORKS Auto Conversion

Setup

  1. Create a new SOLIDWORKS document:
    1. File > New > Part or Assembly.

      Create a New File in SOLIDWORKS


    2. If editing an existing template, the Part (.prtdot) and Assembly (.asmdot) can be opened directly.

      Open an Existing SOLIDWORKS Template

  2. Assign Default Unit System: Document Units pulldown > select units.

    Set Document Units in SOLIDWORKS

    1. For the initial template, MMGS will be used, as the default unit is grams.

  3. Create Global Variables:
    1. Go to Tools > Equations.

      SOLIDWORKS Equations Manager


    2. Select an empty row under Variable name, then create variable “G”.
      1. Note: A custom property and a global variable cannot share the same name in the same document. Here, we have the Global Variable “G” and the Custom Property “Grams”, so they are unique, but easy to distinguish.

        Create a Variable in SOLIDWORKS

    3. Under Value/Equation, click in the empty field for the variable to open the droplist for additional mapping options.

      Variable Droplist in SOLIDWORKS

    4. Hover over Mass Properties > select SW-Mass for the model mass in the default document unit system.

      Variable Mass Properties in SOLIDWORKS

    5. After SW-Mass, add “/1 to the expression to calculate for the mass in grams.

      SOLIDWORKS Equations Manager Unit Conversion

  4. Repeat Step 3 for additional unit conversions.

    Set Global Variables in SOLIDWORKS

    1. For the Global Variable “LB”, the expression will be “SW-Mass” / 453.6.
    2. For the Global variable “KG”, the expression will be “SW-Mass” / 1000.

  5. Create Custom Properties and link them to the corresponding variable.
    1. Go to the Properties tab > Custom.

      SOLIDWORKS File Properties Icon

    2. Click under Property Name > create a new property called "Grams".

      Create a Custom Property in SOLIDWORKS

    3. Click under Value/Text Expression and select the dropdown for additional options.

      SOLIDWORKS Custom Property Dropdown List

    4. Select “G” from the list of available document properties, equation variables, and mass properties.

      Select a Global Variable in SOLIDWORKS

    5. After the expression “G@Part.sldprt”, type in “g” to add unit notation at the end.

      Add Units in SOLIDWORKS File Properties

    6. The formatting of the value can be reviewed in the right-hand column.

      SOLIDWORKS Custom Properties

  6. Repeat Step 6 for additional unit conversions.

    Additional SOLIDWORKS Custom Properties
     
    1. For “Pounds”, the expression will be “LB@Part.sldprt” lbs.
    2. For “Kilograms”, the expression will be “KG@Part.slprt” kg.
    3. Select OK to save properties.

  7. Save as a Document Template: Save As > .prtdot for Parts and .asmdot for Assemblies.

    SOLIDWORKS Save As Document Template

    1. If editing an existing document template, hit Save, and the changes will be applied directly.

  8. Test the mapping and equations by making a new test model and assigning a material or inserting model geometry.

    Automatic Unit Conversion in SOLIDWORKS File Properties

  9. Note: It’s recommended to develop separate document templates for different unit systems as the unit notation in the Custom Property and the conversion factors used in the Global Variables are static and will not correct when the document is changed to a different unit system like in SOLIDWORKS 2024.

Summary

For all new documents moving forward, these properties will now be embedded and automatically updated as their given model changes. Now that units are part of the text of the properties themselves, they are easily visible and searchable in BOMs, drawing annotations, and even SOLIDWORKS PDM data cards.

SOLIDWORKS BOM Title Block Data Card Examples

However, it is important to remember that SOLIDWORKS is doing the mass calculations, and therefore, for the values to be up-to-date and accurate, rebuilds at the file level must be evaluated by opening and rebuilding in SOLIDWORKS itself.

Want to learn more? Check out more tips and tricks listed below. Additionally, join the GoEngineer Community to create forum posts, enter design contests, and answer questions from other SOLIDWORKS users. 

SOLIDWORKS CAD Cheat Sheet

SOLIDWORKS CAD Cheat Sheet

SHORTCUTS ⋅ MOUSE GESTURES ⋅ HOT KEYS

Our SOLIDWORKS CAD Cheat Sheet, featuring over 90 tips and tricks, will help speed up your process.

 

Related Articles

Exploded Views for SOLIDWORKS Multibody Parts

Faster DWG Conversions Using the SOLIDWORKS 2D to 3D Toolbar

Create Custom Weldment Profiles in SOLIDWORKS

SOLIDWORKS Paragraph Properties Guide

Mastering Basic Part Modeling in SOLIDWORKS: A Step-by-Step Guide

VIEW ALL SOLIDWORKS ARTICLES

 

About Miguel de Villa

Miguel de Villa is a SOLIDWORKS Elite Applications Engineer with a B.S. in Mechanical Engineering from the University of California, San Diego. He’s been working at GoEngineer since 2017 helping customers with all their SOLIDWORKS, Simulation and PDM needs. In his free time he enjoys working with his 3D printer, playing video games and building model kits.

View all posts by Miguel de Villa