Hide Table of Contents

Formula management

Project settings > General

Project settings > Mark

Wire style management > Wire properties

 

SOLIDWORKS Electrical uses variables that send information from the database (Component marks, wire numbers...). This information can be handled via the Formula management so that it is presented according to your needs.

For example:

Equipotential number coming from the database: 5

This value is stored in the variable EQU_NO.

If you want to present this information on your drawing as 005 (displayed with three characters), you need to use the following formula: STRZ(VAL(EQU_NO), 3, 0)

Using the Formula management

SOLIDWORKS Electrical is delivered with a large number of predefined formulas, and we recommend using them. However, if your needs require the creation of your own formula, we will discuss some elements that you would need to construct your formula in a simple manner.

 

- A formula is made up of variables (available in the third tab) and text. The strings of text need to be placed within quotes and each variable or string of text must be separated by a + sign. For example: CHAN_TYP + ":" + COM_VAL1 + "." + CHAN_ADDR

 

- The variables are generally of Text type, even when they have a numeric appearance (e.g.: EQU_NO variable that sends the equipotential number).

 

- Certain functions are often used to work on a variable.

STRZ (VAL(FIL_NO),2,0) sends the drawing number represented by two characters. The missing character here is replaced by a 0 (e.g.: 01, 02, ...).

 

VAL: Converts a chain of characters into a number. As EQU_NO is a string of characters, it needs to be transformed into a number as the function STRZ handles only numeric values.

STRZ: Converts a numeric value by imposing a certain number of digits (2 in this example), and the number of decimals (0 in this example).

 

- You can use mathematical functions (+ - * /) to modify the result of the variables.

STRZ(VAL(EQU_NO)*2,3,0) sends the equipotential number represented as three characters, but only using even numbers.

STRZ((VAL(EQU_NO)*2)-1,3,0) sends the equivalent of the result of the previous formula, but only using odd numbers.

 

If you enter a wrong formula, a message is displayed on the bottom of the dialog box.

 

 

Lets you test the formula.

 

 

The dialog box has four tabs to help you to create your formula.

Predefined formulas

This tab groups all predefined formulas according to the element you want to associate with a formula. In the list, select the formula and click the Replace formula button to replace the existing formula.

If you wish, you can manually modify this formula. A message notifies you when the formula is invalid.

Recent formulas

This tab displays the old formulas you used. As in the first tab, you can replace the active formula by selecting an existing formula and clicking the Replace formula button.

Variables and simple formulas

This tab allows you to create your own formula.

Simple formula: This column displays the list of variables available and simple formulas using these variables.

Description: This column gives you a description of the selected variable.

Type: Displays the variable type to help you use specific functions such as VAL or STRZ.

Add a simple formula: To create the formula, select the variable and click the Add a simple formula button.

You can add text but it must be between quotes ("TEXT") and each text and variable must be separated by the sign +. A message notifies you when the formula is invalid.

Functions

This tab lists all the functions and operators you can use in the formula.

Function: Displays the function name. Functions are sorted by type, mathematical, text and various functions.

Description: Displays the function description (definition).

Example: Displays an example of the function use and its syntax. At the end of the example, you can find the result of the function.

As the previous tab, click the Add a function button to add the function to the formula.



Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   Formula management
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: SOLIDWORKS Electrical 2022 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.