Create a Variable Using a Function or Subroutine - SmartSketch - Help

SmartSketch Help

Engineering and Schematics
  1. Click Tools > Variables.

  2. In the Variable Table, in the Unit Type list, select the unit type. This is the unit type for the variables value. The default type is Distance.

    To store a value without units, select Scalar from the list.

  3. In the Name column, click an empty cell.

  4. Type a name for the variable that you want to create. Press ENTER.

  5. In the same row, in the Formula column, click a cell.

  6. Click Function Wizard.

  7. Click the function that you want in the Function Wizard dialog box.

  8. Type the appropriate values in the dialog box. The Function Wizard dialog box displays the available functions and appropriate input. For example, if the variables Var1 and Var2 already exist, some valid formulas using functions are as follows:

    Sqr(Var1) * Sin(Var2)
    Sqr( Var1^2 + Var2^2 )

    References to existing variables in a formula are case-sensitive. For example, if you create the variable Var1, you cannot reference it using var1.

  • You can write external functions and subroutines in BASIC and use them as variable formulas. You can write these functions in Visual Basic, or any text editor, and save them in a .BAS file. The Function Wizard steps you through the process of selecting the BASIC module, the specific function, and the necessary input and output.

  • If you type a function and you cannot remember the argument list, press CTRL + A after you have typed the equal sign, function name, and opening parenthesis. This activates the Function Wizard with the function already selected for you.

  • You can also type expressions with functions directly in the cell in the Formula column.

See Also

Open Source Command
Paste Link Command (Shortcut Menu)
Filter Command (Variable Table Shortcut Menu)