Value Input (General Advice on Formulas and Variables)
Whenever HiCAD requests a value input, you can also use formulas instead of a numeric value. These formulas can contain the permissible mathematical operators and functions etc. Furthermore, you can also use variables within the value input. They are managed in the variable table and can, for example, be changed or deleted there.
Formulas /variables can be used, for example, in point options and value inputs (e.g. height, length, offset thickness).
Using formulas
You can enter formulas directly when creating or processing a part or subsequently in the feature log.
If you want to use a formula instead of a value in the feature log or change an existing formula, activate the value input window by double-clicking the relevant entry in the feature log, e.g. height of a part.
Enter the formula. If the formula you enter contains variables, HiCAD asks for the initial value of the variables. Once the entry has been concluded, the formula is displayed in brackets after the value in the feature log.
Please note the following:
You can use points or commas as separators. In functions with more that one parameter (e.g. distance_points
) a semicolon must be used as separator between the parameters. When loading older formulas (older than HiCAD Version 1800) commas will be replaced with semicolons.
Part variables can contain formulas, which in turn refer to other variables. For example for a cuboid, which should be twice as high as wide and twice as wide as long:
In this case it is sufficient to change the value of the variable length, so that also width and height are adapted automatically:
It may not occur that variables refer cyclically to themselves. Otherwise an error marking is indicated at the variables concerned and the values of the formulas are no longer updated. If you point with the mouse at an error marking, an explanation of the error and the affected variables is displayed:
In this case, edit the affected formulas to resolve the cyclic dependency and enable the automatic calculation of the formula values again.
It is also possible to access part variables of any other parts.
Edit variables
The variables used are managed in so-called variable tables.
To activate a variable table, choose one of the following functions:
- Part variables
All variables of a part are displayed.
- Feature variables
Only the variables of the current feature are displayed.
You access these functions by right-clicking a feature or double-clicking in an empty area of the tab.
The variable table provides the following functions:
- Rename variable,
- Delete variable,
- Add new variable,
- Insert variable,
- Copy variable,
- Cut variable.
To change the value of a variable, proceed as follows:
- Mark the entry and enter the new amount in the input field.
- Double-click the HiCAD pocket calculator to activate it and enter the new value.
The context menu, which you activate by right-clicking a variable name, provides the other functions.
Please note:
- You use the Copy variable and Cut variable functions to copy the data to text form in the clipboard. You can then insert this data into other programs such as Word, Excel etc.
- Similarly, the Insert variable function transfers the data in the same format. For example, you can use the clipboard to insert data that was saved in a semi-colon separated file in Excel into the variable table.
- The default setting in the feature configuration also applies here to updating the feature model.
Feature Technology: Context Menu • Feature Parameter Formulas • Element Variables