SOLIDWORKS Electrical Custom Library Design Rule Check

Article by Cheri Guntzviller on Sep 09, 2025

SOLIDWORKS Electrical is a powerful schematic package that is built on an SQL database. It brings a wealth of benefits, like real-time project collaboration and smooth part organization. Thanks to this architecture, users can effortlessly create nearly any report and design rule check they might need for their projects.

While it's certainly possible to create numerous design rule checks to ensure projects are consistent and accurate, one important check to highlight is confirming that you're using approved or scrubbed parts for the best project efficiency. This process is especially effective when a library system is embraced within SOLIDWORKS Electrical. For those interested, we’ve previously shared insights on adopting a library system. 

Let's explore how to create a check to ensure you're using approved library parts.

Some companies use an ERP system. In the Manufacturer Part management, the Article field can potentially be used to place these ERP numbers or company numbers.

SOLIDWORKS Electrical Manufacturer Part Properties Article Number Field

A library can be utilized for compliant components; however, it may also be necessary to possess an ERP or company identification number. Furthermore, conducting a Design Rule check to ensure the inclusion of these items in your components could be essential.

It is already established that the software compiles the component manufacturer parts as they are incorporated into a project via a Bill of Materials report. This report is located in the Reports section of the software.

We will walk through the process of taking an existing Bill of Materials, duplicating it, converting it to a Design Rule check, and then modifying it through filters to achieve the desired results that we require.

To duplicate a report, have a project open within the software. 

Proceed to the Electrical Project tab in the upper ribbon and navigate to Configurations. In the dropdown menu, under Report, locate the Bill of Materials for your desired duplication. Highlight the name of the report and select Duplicate from the window menu. In this example, I have chosen the report called ”ReferenceGroupByManufacturer_Imperial”. 

Rename the report under the General tab. It is suggested to change both the Name and the Description so it is easily identified. Close the report after renaming.

 SOLIDWORKS Electrical Report Option in the Electrical Project Configuration Dropdown Menu

SOLIDWORKS Electrical Report Configuration Management Application Configurations

SOLIDWORKS Electrical Report Configuration Edition

Once the report is duplicated, move it from the Reports section of the software to the Design Rule Check area. To do this, highlight the name of the duplicate, right-click, and select Change to Design Rule.

Close the Report management window. Proceed to the Electrical Project tab > Design Rule Check. Within the Design Rule Check dialog window, select the Add button. Checking the checkbox for your desired DRC will enable you to add this design rule to your project. Select OK to display the design rule in your view window. Highlight this report and choose Properties to modify which fields or columns need to be included in this query.

To ensure all of the manufacturer parts within this project are in the correct library and have article numbers, remove all of the fields other than part number, manufacturer part number, article number, and mark. To do so, select the Columns tab, utilizing the columns management to uncheck all unnecessary fields. You may notice that Library is not an available selection. 

SOLIDWORKS Electrical Columns Configuration

So, how do we go about creating a check that confirms we have used approved library parts? Let’s take a bit of a step back.

To identify what library a part is in, utilize the Activate Expert Mode to add more to the report query.

SOLIDWORKS Electrical Activate Expert Mode

Important Note: Editing a report by activating Expert Mode can break the report or DRC. Proceed if you are proficient in programming language.

Before moving into Expert Mode, let’s discuss how these variables are organized. We will be utilizing a keyword in our design rule check. The keyword is %APP_CATALOG%.

SOLIDWORKS Electrical Design Rule Check Keywords

Design Rule Check Keywords in SOLIDWORKS Electrical

Let's look at how to utilize the keyword %APP_CATALOG% in the design rule check. I tend to think of queries (reports and design rule checks) in terms of hierarchy. In typical queries, hierarchy will show as TABLE.VARIABLE (meaning a specific table name followed by a separation period, then the variable name). A keyword is just one level above a table, so you end up with KEYWORD.TABLE.VARIABLE. For this query, we just need to show association between the APP_CATALOG variable “tew_catreference” and the MANUFACTURERPART variable “bom_reference”. These variables must be declared in your report along with the variable “cre_lib_name”.

Press the Activate Expert Mode key and accept the notification. 

To declare these variables, you will need to locate them in the list of variables on the right-hand side. Before you can declare the variable, select EDIT at the bottom of the window. Double-click on each in the list to declare it. The software will then add them to the declarations portion of your report. The first two screen captures are for the tew_catreference.cre_reference variable.

Declare Variables in SOLIDWORKS Electrical

SOLIDWORKS Electrical Variable Reference Description

These next two screen captures are for the cre_lib_name variable.

Declare Variables in SOLIDWORKS Electrical

Create Library Name in SOLIDWORKS Electrical

The last variable, vew_manufacturerparts_ex.bom_reference, should already be declared at the top of the report. Verify this by scrolling to the top of the SQL query and making sure the variable is declared.

Now that the variables have been declared, a final statement is required to be able to call out the library. We need to join two tables. 

Ensure you are in the FROM section of the report, then add the following line to make the association:

RIGHT JOIN %APP_CATALOG%.tew_catreference ON vew_manufacturerparts_ex.bom_reference = %APP_CATALOG%.tew_catreference.cre_reference

In this example report, it looks like the following:

SOLIDWORKS Electrical Report

To save your modified SQL query, you must first test it.

Multiple tests may need to be run to correct the syntax. I have found that occasionally, the report will reset itself, and the changes are required a second time. Don’t get frustrated. You will need to ensure that the table of your FROM statement is the same name as the table called out after the ON statement in the first portion before the period.

Test SOLIDWORKS Electrical Report

If you are successful, the query will allow you to apply your changes. With the addition of variables, columns must be added to accommodate these additions. Select APPLY to have it test one more time. The Design Rule may close after applying. If so, please select the query and go to properties once more.

If you wish to have less in this report presented on screen and only want a few columns, proceed to the column management icon within the Column tab of the DRC. Uncheck any boxes that are not needed in this specific report. This example will use just the part number (reference) and article number. We will need to add a column for the Library field to be available.

Column Management in SOLIDWORKS Electrical

To add a new column for the library, navigate to the Add Column button.  Add a description of the Library, click the Formula button, and select the “cre_lib_name” variable by double-clicking on it. Press OK to add this column to the report.

Add a Report Column in SOLIDWORKS Electrical

Unchecking the "Duplicate in list" checkbox in the Columns tab for the Library will provide the information you need.

In the Sort and Break tab, use the arrows to move all of the sort order and break conditions from the right side of the window to the left, select only utilizing the “bom_reference” with the box unchecked for Break.

SOLIDWORKS Electrical Sort and Break Tab

When finished, save and close the report. Adding a filter to this report in the DRC list will remove all parts that do meet the criteria and only provide the parts that do not meet the specific needs.

Now, we need a filter condition. We only want to see the problem conditions, so we can filter by anything not in our preferred library or libraries. Click the Add Filter option on the Design Rule management; a filter window will appear. A condition will already be available for populating. 

Double-click the variable for the library name to add it to the filter. Using the Operator of “!=” will exclude the specific libraries that are not of concern, like your company library name. In the Value dropdown, select your specific company library. (All others would not be in that library and would need to be corrected.)

SOLIDWORKS Electrical Custom Library Rule Check

There you have it! Not only can SOLIDWORKS Electrical utilize a custom library, but you can also verify that projects are adhering to that system. 

Components within your project may need to be corrected once your library is adjusted as you see fit. To do so would mean that you would need to PUSH the updated library into your project. Under the Process tab, the REPLACE DATA function will guide you through what data needs to be updated. Once done, your DRC should be empty, hence all manufacturer parts within the project are now part of your specific company library. This also holds if you want to ensure that all parts have an article number. Following this process, filtering parts that do not have an article number can be identified and repaired, and then pushed back into your project.

Want to learn more? Get the most out of your SOLIDWORKS Electrical software by visiting the links listed below. Additionally, join the GoEngineer Community to create forum posts, enter design contests, and answer questions from other SOLIDWORKS users. 

Editor's Note: This article was originally published in July 2021 and has been updated for accuracy and comprehensiveness.

Related Articles

SOLIDWORKS Electrical Schematic: Displaying Alpha Numeric Rows & Columns

Adding PLC Drawing Configurations to SOLIDWORKS Electrical Projects

SOLIDWORKS Electrical Save Manufacturer Part Info in a Symbol

How to Change SOLIDWORKS Electrical User Data

Reusing Wires in SOLIDWORKS Electrical Across Multiple Projects

VIEW ALL SOLIDWORKS ELECTRICAL ARTICLES

 

About Cheri Guntzviller

Cheri Guntzviller is a Senior Electrical Specialist with over 35 years’ experience. She earned her Bachelor of Science in Electrical Engineering degree from Lawrence Technological University and joined the VAR channel in 2013 with DASI (now GoEngineer). She is a problem solver and is passionate about teaching and helping others solve problems. Based out of Michigan Cheri enjoys gardening, fishing, construction, and spending time with her family and pets. Cheri is a SOLIDWORKS Certified Electrical Specialist, Trainer, and Professional Presenter.

View all posts by Cheri Guntzviller