How to Link SOLIDWORKS System Defined Properties to File Data Card

The information below details how to insert SOLIDWORKS system-defined properties (SW-File Name, SW-Author, etc.) to the associated file data card within SOLIDWORKS PDM.

This is the last SOLIDWORKS PDM blog in a three-part series. The first posting laid the groundwork for understanding different types of SOLIDWORKS drawing file property links ($PRP, $PRPSHEET, $PRPMODEL, and $PRPVIEW). Part I was written with the notion it would benefit both SOLIDWORKS users and SOLIDWORKS PDM administrators. Part II provided instructions on how to link property values from the SOLIDWORKS model to the controls on the drawing file data card. The main audience for this topic was SOLIDWORKS PDM administrators only.

The information below details how to insert SOLIDWORKS system-defined properties (SW-File Name, SW-Author, etc.) to the associated file data card within SOLIDWORKS PDM. Again, this posting is mainly directed towards SOLIDWORKS PDM administrators. Like the second blog, the details contained within apply only to clients with SOLIDWORKS PDM CAD Editor License type. This requirement is reinforced below under the “Exercise” section.

Summary

A customer with many years of both SOLIDWORKS and SOLIDWORKS PDM experience asked; “How do I get the file name into the associated file data card?” You might think, as I did, simply set the default value in the card editor tool for an edit box on the file data card to one of two special values: file name or file name without extension.

The main considerations to keep in mind here are as follows:

1. The file gets renamed during its lifetime.

2. The default value only gets assigned to the data card when the file is added to the vault for the first time.

The solution to overcome these hurdles is to read the SOLIDWORKS system-defined property (SW-File Name) using variable attributes. The process is very similar to linking model properties to the drawing file data card written in the previous blog.

Setup

1. Open SOLIDWORKS PDM administration utility.

2. Create variables through Variable Editor in SOLIDWORKS PDM administration utility. In this case, “FileName” is the chosen name for the variable.

Edit Variable

3. Add an attribute linked to the custom property for SOLIDWORKS files. In this example, the variable is mapped to the “Filename” custom property. Remember, the variable and attribute names are not required to match.

Edit Variable

4. Map variable to control on the file data card. In this example, the “FileName” variable is assigned to an edit box control. See red box (1) in the figure below.

SOLIDWORKS Part Card

5. The business rule for this exercise states the SOLIDWORKS file will drive the value into the edit box for “FileName.” Hence the property for “Read only” is checked. See green box (2) shown in the figure above.

6. Updates all configurations” checkbox is selected. See blue box (3) in figure above. This setting is supposed to update all configurations within the file but does not perform as expected for this purpose.

7. See purple box (4) in figure above. This region of the edit box properties is for setting the default value for this control when the associated file is added to the vault. Notice the default value is “$PRP:'Sw-File Name.'” This was set with the notion that the SOLIDWORKS template file did not have a preconfigured custom property for “Filename.” This too does not perform as expected for this purpose; therefore, leave the value blank.

8. The last step is to configure the custom property in the file or SOLIDWORKS template. See the image below.

 Property Name

9. Optional: For each configuration, set the property in the file or SOLIDWORKS template. See the image below. The red box highlights the configuration and the blue box focuses on the property itself. Again, if the “Updates all configurations” edit box property is checked, this will not work as expected. Hence the purpose of this optional step.

Filename

Exercise

IMPORTANT: The key to making this work is saving the file. In other words, if the file is renamed, it has to be opened in SOLIDWORKS and saved for the update to happen.

1. Open SOLIDWORKS.
2. Enable SOLIDWORKS PDM add-in.
3. Generate a new SOLIDWORKS file: part, assembly, or drawing.
4. Ensure custom and/or configuration property(s) are linked to $PRP:”SW-File Name” and the associated value is shown.
5. Save the file into SOLIDWORKS PDM.
6. Check the file into the vault.

Figure A:

Only custom property is configured.

Filename

Figure B:

The default configuration has no property for file name; therefore, the control on the data card is empty for this configuration. Keep in mind the edit box property for the data card control is set to “Update all configurations.” “Updates all configurations” works when the value is edited through the data card.

Filename

Conclusion

The instructions written in the blog has given you the requisite knowledge to link system properties to SOLIDWORKS PDM file data card for any SOLIDWORKS file type (drawing, part, or assembly). The example system property used for this lesson was the SOLIDWORKS file name. If you read the other parts of this blog series, you would recognize this topic is a slight twist to Part II: linking model properties to the SOLIDWORKS drawing file data card.

In either this or the previous postings, a firm understanding of property links in SOLIDWORKS is necessary. $PRP property link was used in this posting, and in Part II, the $PRPSHEET was employed. If you want to learn more about these property links including $PRPMODEL and $PRPVIEW, then please read Part I of this blog series.