Formulas are used throughout SOLIDWORKS Electrical to customize wire labels, component marks, automated reports and more. They allow you to use SQL variables to extract information stored in the database and automatically present that information in the form of text within your documentation.
Formulas are customized using the formula manager which is accessible through the user interface wherever applicable. The image below is from the project settings and shows the formulas for customizing and generating the various marks within a project. The formulas are displayed for each mark and can be customized by accessing the formula manager using the icon shown at the right.
The formula manager has tabs for Predefined and Recently used formulas. Additionally, there is a Variables and Simple Formulas tab that can be used to build a custom formula. The image below shows the Variables and Simple Formulas tab for Component Marks.
Note that the formula for Component Marks uses two SQL variables and is defined as COM_ROOT + COM_NO. COM_ROOT is a letter (or letters) designated in custom settings and associated to the class or type of element to which the mark is being applied. COM_NO is a number that is incremented for each new mark of a given class of element. A practical example of component marking would be the marks created for control relays.
Control relay marks start with CR1 and COM_NO increments for each subsequent control relay mark (CR2, CR3, …).
Let’s use a more detailed example to describe the customization that is possible using formulas. What if we wanted our wire numbers to include the document number where the wire originates?
This information can be handled via the formula manager so that it is presented according to your needs. Additional information can be added to a formula by adding additional available SQL variables to the formula. In our case we’ll add the SQL variable that is associated to the document number.
Wire numbering can be accomplished using an EQUIPOTENTIAL numbering system or individual WIRE numbering system. For this example we’ll use equipotential numbering which can be set in the wire style manager.
To define the formula for equipotential numbering, we’ll need to access the formula through the properties of the wire style used.
Next, we can modify the equipotential numbering formula using the formula manager. The current formula for the equipotential numbering of a 24V control wire is ‘-‘+EQU_NO+’-‘ which is simply the equipotential number prefixed and suffixed with a dash.
Our goal is to have the equipotential number plus the document number where the wire originates in the wire number. To change the formula we can use the Variables and Simple Formulas tab in the wire manager. We can add the variable FIL_TAG (document number) to the equipotential formula.
The new formula will display the equipotential number (EQU_NO) with a dash then the document number (FIL_TAG). Once the new formula is defined, we can renumber the wires.
SOLIDWORKS Electrical has many tools for customization and formulas are a major part of that toolset. By mastering formulas, you’ll be well on your way to mastering the customization of your electrical documentation.