How to work with custom properties (and cut lists)

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.

All available variables for custom properties

We created a complete list of all built-in SOLIDWORKS variables that are available for custom properties.

Within this post, you’ll find…

  1. What is a custom property?
  2. Edit properties: File properties / Summary Information window
  3. Don’t add a property in both the Custom and Configuration Specific tabs
  4. Data types
  5. How to add a custom property
  6. Change the pre-defined custom properties
  7. Change the (unlinked) properties for weldment templates (sldlfp files)
  8. How to fix the error “The properties.txt file cannot be located”
  9. How to use special characters
  10. Linked properties for derived parts
  11. Use weldment bounding box dimensions for body names
  12. Using variables as custom property values
  13. How to use custom properties in equations
  14. How to add custom properties to a design table
  15. How to show custom properties in a bill of materials
  16. Custom properties for drawings
  17. A list of available variables
  18. What do $PRP, $PRPSHEET, $PRPVIEW, $PRPMODEL and $PLMPRP mean?
  19. Working with the model, configurations and bodies
  20. How to use cut list properties
  21. Can you link cut list properties to file properties?
  22. One special property: the description
  23. One missing property: the item number
  24. Property Tab (Builder)
  25. Custom properties and the API
  26. Superpowers for custom properties

1. What is a custom property?

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.

2. Edit properties: File properties / Summary Information window

You can access the metadata for a file here:

solidworks view file properties

When you open that window, you see it has three tabs:

  1. Summary info: contains file properties that are readable by Windows
  2. Custom: custom properties for the model
  3. Configuration Specific: custom properties for each configuration

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.

summary info

3. Don’t add a property in both the Custom and Configuration Specific tabs

Nothing stops you from adding a custom property with the same name to both the file properties and the configuration-specific properties. But you shouldn’t because it will confuse you, your colleagues and SOLIDWORKS.

When you use a custom property in a (drawing) note, SOLIDWORKS checks the configuration-specific properties first. If it finds one with the correct name, it returns the value of that property. If it doesn’t find a property, it checks the list of file-based properties and returns that value.

There is no way to tell a note to use either a file-base property or a configuration-specific property.

4. Data types

There are four data types available:

  1. Text
    • The most basic type, the most useful type, and the default. The maximum length is 1023 characters.
  2. Date:
    • Warning: dates are localized. That means they appear different and they depend on the system language of the PC that created the model. They’re not ideal.
  3. Number:
    • These can be whole numbers (integers) or comma values (doubles). SOLIDWORKS seems to round and evaluate these value values and shows you the result.
    • 24 becomes 24
    • 24.0 becomes 24.0
    • 24.0000000000000000001 becomes 24.000000
  4. Yes / No

5. How to add a custom property

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.

6. Change the pre-defined custom properties

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.

solidworks custom property properties options

You can change these options though. In two ways:

  1. Click Edit List in the window shown above, enter a name, then click Add
  2. The names are read from a text file, located here:

solidworks properties.txt cannot be located file location

Open the text file in a text editor of your choice, et voila. Just add a custom property per line to add your own.

solidworks custom properties list text file

7. Change the (unlinked) properties for weldment templates (sldlfp files)

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:

weldment profile cut list custom properties

Now when you create a weldment with this template, the new custom property shows up in your cut list:

weldment sldlfp custom properties not linked unlinked

8. How to fix the error “The properties.txt file cannot be located”

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.

9. How to use special characters

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: 2@" X 2@" X 1/4@".

10. Linked properties for derived parts

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:

solidworks linked properties derived part

11. Use weldment bounding box dimensions for body names

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.

12. Using variables as custom property values

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:

select variable for custom property value

Mass will be converted to a cryptic text: “SW-Mass@<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.

13. How to use custom properties in equations

In general, custom properties are just text. But you can do a few special things to combine equations and custom properties:

  1. You can use multiple variables inside a custom property. SOLIDWORKS will concatenate them.
  2. You can use custom property values in equations. Start typing the name of the custom property
  3. You can use equation results in custom properties. Just use the full name of the dimension.
  4. You cannot do equations in custom properties.

Here’s how it works:

First, create a custom property. It can even be a text property, it doesn’t have to be a number!

custom property in equations

Then use it in an equation. Simple as that. I multiplied it by two before I took this screenshot.

custom property in equations

You can store the result of global variables and calculated dimensions (like “D1@[email protected]”) into a custom property as well.

14. How to add custom properties to a design table

The easiest way is to:

  1. Create a part or assembly
  2. Add a design table
  3. Close the design table
  4. Add a custom property
  5. Open the design table. SOLIDWORKS will now ask you if it should add the custom property.

You can also add the custom property manually. The syntax is simple:

$PRP@<property-name>, so for example $PRP@Description

We’ll explain this syntax in section 18: What do $PRP, $PRPSHEET, $PRPVIEW and $PRPMODEL mean?

15. How to show custom properties in a bill of materials

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.

custom property column bill of materials bom

Now you can pick the custom property you want to show in that column.

custom property column bill of materials bom

16. Custom properties for drawings

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).

Method 1: Create a linked note through the user interface

To add a note that is linked to a custom property:

  1. Click Note
  2. Click Link to property
  3. Select Current document (this drawing) or Model found here (the part or assembly)
  4. Select a custom property
  5. Click OK

You can even create a note with multiple properties.

drawing custom properties note link

Method 2: Create a linked note manually

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:

prpsheet sw-author solidworks custom property

One note: you cannot tell SOLIDWORKS to use the file-specific or configuration-specific properties. See section 3 for more details.

17. A list of available variables

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.

Are variable names case-sensitive?

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”.

Ditch the Toolbox, once and for all

Start using the fastener library that actually follows the standards
  • No more mate errors
  • Made for speed
  • No yearly license fees

18. What do $PRP, $PRPSHEET, $PRPVIEW, $PRPMODEL and $PLMPRP mean?

When you want to use a variable, you need one of these prefixes, followed by the variable name.

These prefixes tell SOLIDWORKS where to get its data from. $PRPVIEW uses the model that is in the view, for example.

  1. $PRP
    1. A property linked to the current model or drawing (called Current Document).
    2. Presumably, it’s short for property.
    3. When in doubt, try this one.
  2. $PRPMODEL
    1. Property of the component to which the annotation is attached.
    2. Works for parts and assemblies.
  3. $PRPSMODEL
    1. Very rare.
    2. Use this when adding a note to the sheet, to reference a component in an assembly, in a view
    3. Practice this one in notepad and paste it into SOLIDWORKS, because it’s hard to get right.
  4. $PRPSHEET
    1. Property of the model in the view specified in Sheet Properties.
    2. Only use this to add a note to a sheet. For example, when adding notes to a title block.
  5. $PRPVIEW
    1. Model in the drawing view to which the note belongs.
    2. Use this when you add a note to a view.
  6. $PRPWLD
    1. Property of a cut list folder or a BOM property.
    2. Use this to add a note to a drawing view that uses (weldment) cut list properties like Length or Angle.
  7. $PLMPRP
    1. Property of a model in 3DEXPERIENCE. They are called product lifecycle management (PLM) attributes on that platform.
    2. Can only be used in the Configuration Properties tab of parts and assemblies and the Custom tab of drawings. This is because every configuration is its own model in 3DEXPERIENCE, there are no higher-level things like ‘files’ there.
    3. These properties are only updated when you use SOLIDWORKS Connected or the SOLIDWORKS Connector add-in and you are connected to 3DEXPERIENCE.
    4. If you are not connected or you use SOLIDWORKS Desktop, you see three asterisks (***) and a warning at the bottom saying “*** Property will be updated when connected to the platform”. You need at least SOLIDWORKS 2022 for this.
    5. You can only map PLM properties to CAD, not the other way around.

$plmprp 3DExperience custom property

How to add a linked note from the user interface

  1. $PRP
    1. Click Note in the Annotation toolbar
    2. Click anywhere on the sheet or in the model to select the location
    3. Click Link to property in the properties window
    4. Select a property from the dropdown
    5. Click OK
  2. $PRPMODEL
    1. Click Note in the Annotation toolbar
    2. Click Link to property in the properties window
    3. Select Model found here 
    4. Select a property from the dropdown
    5. Click OK
  3. $PRPSMODEL
    1. Click Note in the Annotation toolbar
    2. Click on the sheet
    3. Click Link to property in the properties window
    4. Select Model found here 
    5. Select Selected component or other drawing view
    6. Click on a component
    7. Select a property from the dropdown
    8. Click OK
  4. $PRPSHEET
    1. Click Note in the Annotation toolbar
    2. Click on the sheet
    3. Click Link to property in the properties window
    4. Select Model found here 
    5. Select a property from the dropdown
    6. Click OK
  5. $PRPVIEW
    1. Click Note in the Annotation toolbar
    2. Click Link to property in the properties window
    3. Click on a view
    4. Select Model found here 
    5. Select a property from the dropdown
    6. Click OK
  6. $PRPWLD
    1. Click Note in the Annotation toolbar
    2. Click on a body in a drawing view so the note is attached to that body
    3. Click Link to property in the properties window
    4. Select Model found here 
    5. Select Component to which the annotation is attached. This option is only available if you have clicked on a body in step 2.
    6. Select a property from the dropdown
    7. Click OK
  7. $PLMPRP
    1. From what I tried, it is not possible to add a link to this property from the user interface.

How to add a linked note manually

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.

  1. $PRP:
    1. Blueprint: $PRP:”<property name>”
    2. Example: $PRP:”SW-Title”
  2. $PRPMODEL:
    1. Blueprint: $PRPMODEL:”<property name>”
    2. Example: $PRPMODEL:”SW-Title”
  3. $PRPSMODEL:
    1. $PRPSMODEL:”<property name>” $COMP:”<Assembly name>-<instance number>@<view name>/<part name>-<instance number>@<assembly name>”
    2. Example: $PRPSMODEL:”SW-Title” $COMP:”AssemblyName-3@Drawing View3/PartName-1@AssemblyName”
  4. $PRPSHEET:
    1. Blueprint: $PRPSHEET:”<property name>”
    2. Example: $PRPSHEET:”SW-Mass”
  5. $PRPVIEW:
    1. Blueprint: $PRPVIEW:”< custom property name>”
    2. Example: $PRPVIEW:”Weight”
  6. $PRPWLD:
    1. Blueprint:  $PRPWLD:”<property name” of <part name>
    2. Example: $PRPWLD:”Length” of Part1
  7. $PLMPRP:
    1. Blueprint: $PLMPRP:”<property name>”
    2. Example: $PLMPRP:”Revision”

Source

19. Working with the model, configurations and bodies

There are multiple levels. Fortunately, you can recognize them by the number of @-signs.

  1. Normal custom properties:
    • Double quote – Variable name – @ – Filename with extension – Double quote
    • Example: “SW-Mass@Launch pad.SLDPRT”
  2. Configuration-specific properties:
    • Double quote – Variable name – @@ – Configuration name – @ – Filename with extension – Double quote
    • Example: “SW-Mass@@DefaultSM-FLAT-PATTERN@Launch pad.SLDPRT”
  3. Body or feature properties:
    • Double quote – Variable name – @@@ – Body name (with instance number) – @ – Filename with extension – Double quote
    • Example: “SW-Mass@@@TUBE, SQUARE 20 X 20 X 2<3>@Strongback.SLDPRT”
    • For a reason unknown to us, this doesn’t always work the Description property.

20. How to use cut list properties

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.

cut list bom properties length quantity

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 triple-@ body syntax we explain in section 19. An example:

“SW-Mass@@@TUBE, SQUARE 20 X 20 X 2<3>@Strongback.SLDPRT”

But as noted in section 19, 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.

22. One special property: the description

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.

23. One missing property: the item number

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.

24. Property Tab (Builder)

SOLIDWORKS created the Property Tab so you can quickly enter relevant model information and store it in custom properties.

solidworks property tab

(The tab below that one is for our drawing automation add-in Drew)

Property tab templates

You can create four different kinds of templates for the contents of this tab:

  • For parts
  • For assemblies
  • For drawings
  • For weldments

These templates are actually just XML files with a fancy extension. They are stored in the same folder as properties.txt.

Property Tab Builder

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

property tab builder

To create a new template, follow these steps:

  1. Create a new file
  2. Select the model type in the right column. If you only see details for an input, click on an empty space in the center column to show the model type.
  3. The left column shows every type of input you can use. Drag an item from the left column to the center column to use it
  4. Set the details in the right column
  5. Click save and pick a file name

If you want a more in-depth article, check out this one.

25. Custom properties and the API

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.

  • Custom properties:
    • Get ModelDocExtension.CustomPropertyManager and use that object with Get5 or Get6 (2018 and newer) to get the value and Set2 to set the value.
    • Pass an empty string when getting the custom property manager to get the custom properties for the entire part/assembly.
    • Pass the configuration name to get or set configuration-specific custom properties.
  • Cut list properties:
  • Summary info:
    • Use this method to get the Title, Summary and other special properties.
    • Use ModelDoc2.SummaryInfo(id) to get or set items that appear in the Summary tab. Pass zero as the argument to get the Title, pass 1 for the Subject.

We now also have a dedicated article for custom properties and the API. Check out How to use custom properties in the SOLIDWORKS API to learn more.

26. Superpowers for custom properties

The wonderful people at ATR Soft created CUSTOMTOOLS, a powerful suite of productivity tools.

CUSTOMTOOLS uses custom properties for many of its automations. So go check them out.

Don't miss the next post. Get a free add-in.

Subscribe to our newsletter and get our TimeSavers add-in for free.