Custom properties are extra data fields for your models.
You can add text like a description, who created the model and the last revision number.
And if you use them right, they can give you superpowers.
We created a complete list of all built-in SOLIDWORKS variables that are available for custom properties.
A custom property is a piece of text that is stored within your model file. It’s what we call metadata.
You can use custom properties to store the model mass, the person that created the file, the revision number. The possibilities are endless.
That’s why PDM and CustomTools use them everywhere.
You can access the metadata for a file here:
When you open that window, you see it has three tabs:
Drawings have no configurations, so the last tab is not present for drawings.
The BOM quantity is a special extra field that we previously wrote about here.
There are four data types available:
To add one, click the last row with <Type a new property> and create a name. You can also pick one from the dropdown list. We’ll show you how to edit this list in the next section.
After that, pick a type, fill in a value and press enter again to store everything.
If you add a property in the Configuration Specific tab, the property is only added for the selected configuration. The other configurations don’t automatically get this property.
When adding a custom property to a part or assembly, you see a list of pre-defined options. These are just proposed names and they have no real meaning. You can select one of these or enter a custom name.
You can change these options though. In two ways:
Open the text file in a text editor of your choice, et voila. Just add a custom property per line to add your own.
Did you ever notice that the Description property in cut lists is not linked?
That is because this property comes from the weldment template for that body. These templates are .SLDLFP files. As it turns out, you can add properties to these files and they show up in your cut list.
Just open an SLDLFP file in SOLIDWORKS and add a custom property on the file level:
Now when you create a weldment with this template, the new custom property shows up in your cut list:
This error just means that the file from the image above cannot be found. You can copy one from the internet or create your own.
Javelin wrote a blog post on how to fix this error as well.
The SOLIDWORKS help page says the following:
When you define a custom property that includes a single or double quotation mark (‘ or “), type an @ sign in front of the quotation mark to ensure that the expression evaluates correctly. For example: [email protected]" X [email protected]" X 1/[email protected]".
When you make a derived part, for example a mirrored version, you could enable linking custom properties between the parts.
This link could not be changed or removed in older SOLIDWORKS versions.
SOLIDWORKS 2018 and newer allow you to specify which custom properties remain linked:
According to this article in the SOLIDWORKS help, you can customize the name of cut list bodies and sheet metal bodies.
You can use custom properties like SW-Thickness, SW-Length, and SW-Width and enter your own prefix and suffix. The result should be something like “Plate, 20x30x300”
We have tried it, but so far it did not work for weldment bodies, only for sheet metal bodies.
Now that we have explained the basics, let’s start using some more advanced stuff.
Because custom properties become way more powerful when you use variables.
When entering the value of a property, notice that you can pick a pre-defined variable like the model mass:
Mass will be converted to a cryptic text: “[email protected]<model-name.SLDPRT”.
Don’t forget the quotes.
This is how SOLIDWORKS stores a variable. This variable is then evaluated when the value is requested.
We also created a list of all the available variables because we could not find a good overview.
I never knew this was possible. You can actually use custom property values in equations. And store the result back in a custom property!
First, create a custom property. It can even be a text property, doesn’t have to be a number!
Then use it in an equation. Simple as that. I multiplied it by two before I took this screenshot.
You can store the result of global variables into a custom property as well. It seems you can only use global variables, not other equations.
The easiest way is to:
You can also add the custom property manually. The syntax is simple:
We’ll explain this syntax in section 17: What do $PRP, $PRPSHEET, $PRPVIEW and $PRPMODEL mean?
You can show the custom property values for all assembly components in a bill of materials. Click the row above the BOM, I clicked on the G, then click on the Column Property button.
Now you can pick the custom property you want to show in that column.
You cannot link custom properties between a part/assembly and the drawing, unfortunately.
The best method is to have all custom properties in the part or assembly, then link to those in the drawing.
Because you can use model properties in drawing notes.
That means you can create notes, blocks (a block contains one or multiple notes) and smart title blocks (which are also just a bunch of notes).
To add a note that is linked to a custom property:
You can even create a note with multiple properties.
You can also type the note yourself and SOLIDWORKS will replace the text with the custom property value.
Get a sneak preview by hovering over existing notes:
We created a separate blog post with a list of all available variables for custom properties. Check it out and don’t forget to bookmark the post.
Nope, they are not. “LENGTH” and “length” will both work.
Although, in very rare cases, SOLIDWORKS seemed to be case sensitive. It’s very annoying. One example is “SW-Configuration Name”.
When you want to use a variable, you need one of these prefixes, followed by the variable name.
These prefixes tell SOLIDWORKS where to gets its data from. $PRPVIEW uses the model that is in the view, for example.
The best way to practice these is in notepad because some of these are very hard to get right. Then copy and paste them into SOLIDWORKS.
If you have created one correctly, SOLIDWORKS will directly replace the variable with the value. The result might be empty, that’s when you see your input code disappear.
There are multiple levels. Fortunately, you can recognize them by the number of @-signs.
You can use all properties from a cut list in drawing notes.
The easiest way is to add a note, click the button Link to property, select Model found here, then Component to which the annotation is attached. Now you can select Length for example.
To do this manually, use $PRPWLD:”property name” and add “of” and the file name at the end.
Not really. But if your part has only one body, you can hardcode the cut list properties of that body in the file properties. You should use the [email protected] body syntax we explain in section 18. An example:
“[email protected]@@TUBE, SQUARE 20 X 20 X 2<3>@Strongback.SLDPRT”
But as noted in section 18, the Description doesn’t work.
If you really want to keep these properties up-to-date, we have to add some code. I have an idea for building a custom feature that can do this. So if you need this, get in touch.
Barbara Jerin recently wrote a nice article on LinkedIn about one property that’s more special than the rest.
It’s the Description property.
You can use it as a column in Windows Explorer, for example.
Check out her article here.
My visitors and I have never been able to find the item number as a variable.
If you have found a way to use the item number from a BOM or Cut List, please let me know.
SOLIDWORKS created the Property Tab so you can quickly enter relevant model information and store it in custom properties.
(The tab below that is for our drawing automation add-in Drew)
You can create four different kinds of templates for the contents of this tab:
These templates are actually just XML files with a fancy extension. They are stored in the same folder as properties.txt.
Because the templates are XML files, you can edit them in any text editor you like.
But it might be simpler to use the Property Tab Builder that SOLIDWORKS supplies with its software.
It’s a separate program.
You can start it via Start > SOLIDWORKS 20xx > SOLIDWORKS Tools > Property Tab Builder 20xx
To create a new template, follow these steps:
If you want a more in-depth article, check out this one.
There are three different (but slightly confusing) methods to get to the model properties.
SOLIDWORKS has the Custom Property Manager to work with these custom properties. You get this object from the model itself or from the cut list feature.
The wonderful people at ATR Soft created CUSTOMTOOLS, a powerful suite of productivity tools.
CUSTOMTOOLS uses custom properties for many of its automations. You can check it out here.