nanoCAD Platform Help

Expression Builder

Expression Builder Interface

With expression builder you can specify parameters, arithmetic expressions and references to object properties for the selected cell.

You can open expression builder for a table cell and for the Attach object dialog box. Press Shift + F2 to open the dialog box.

CAD drafting Expression Builder 0CAD software Expression Builder 1

In the top part of the dialog box there is a field to enter any arithmetic expressions and use any constants and object properties.

During input, in the list of functions and constants, all items containing input are displayed. If the input is incorrect, a message about the error or a tooltip will be displayed.

CAD drawing Expression Builder 2

Click in the preview and the expression in the input field will be selected.

CAD drafting Expression Builder 3

Press the CAD software Expression Builder 4 button and the entered expression will be saved on the template formula bar.

CAD drawing Expression Builder 5

Expressions from the formula template bar are marked with a star in the list of functions and constraints.

Formula Templates

These allow expressions to be saved in templates for further use.

To save an expression, type it in the field and select the CAD drafting Expression Builder 6 button. The expression’s button will be displayed in the templates list. 

There is a tooltip when you move the cursor over the item.

CAD software Expression Builder 7

To insert a template, select the button of the saved template.

To delete a template, press the Alt button and drag the template button outside the Expression builder dialog box

CAD drawing Expression Builder 8

If there are “$” symbols in the template, after insertion they are changed to the selected text. For example, we create the Iff(Exist($);$;””) template then type the text Object.Name, select it and insert the Iff template and the symbols are changed to the text -  Iff(Exist(Object.Name;Object.Name;””).

Snap to objects

CAD drafting Expression Builder 9 - opens the Attach object dialog box.

Functions in the Expression Builder

Mathematical operations:

+

Addition

-

Subtraction

*

Multiplication

/

Division

^

Raising to the power

sqrt()

Square-root generation

Logical operations:

==

equals

more

less

!

nor

|

or

!=

not equals

>=

not less

<=

not more

||

or

&&

and

Functions:

Mathematical:

Cos, Sin, Tg

- Trigonometric function; argument is specified in degrees.

Acos, Asin, Atg

- Arc trigonometric functions, the result received in degrees.

Abs

- Modulus.

Int

- Rounding of number.

Summ

- Returns the sum of the variables values if the cells are grouped

note! When entering a function, pay attention to brackets.

For example:

Summ(Row) - returns the sum of the numbers of grouped rows.

Summ(Detal.L) - returns the sum of the parameter L values of the “Detail” object in grouped rows.

Data conversion:

Str

- Data conversion to string type.

Num

- Data conversion to numeric type.

Frm

- Numerical value conversion to string type according to the parameters of the table column.

For example:

Frm(0.001230) returns 0.0012 string if zero suppression mode and 0,0000 accuracy are set for the column containing the cell.

Selection and comparing:

FmtText

- Addition of formatted strings.

FmtSub

- Creation of lower index.

FmtSuper

- Creation of upper index.

FmtDigit

- Number conversion to typesetting form.

FmtRaw

- Not formatted text.

FmtDiv

- Creation of fraction.

If/Iff

- function of logical decision. Format:

if(Logical_Condition; If_True; If_False,

where:

Logical_Condition – logical condition with logical operations for comparing;

If_True – returned value, if logical condition is held;

If_False - returning value, if logical condition is not held.

For example:

if(object == Marker; Marker.Position; "Not determined").

If the object type attached to the column cell has a Marker value, the function returns its Position value. 

If the object has another type, the Not determined value is returned.

Exist

Checks the existence of a constant: =IF(EXIST(Object.Name);Object.Name;0)

Min/Max

- Returns the minimum/maximum value listed in the brackets.

For example:

Min(maximum_value; minimum_value) – returns minimum_value;

Max(maximum_value; minimum_value) - returns maximum_value.

Count

- Returns the number of objects (for grouped rows of a table).

For example:

Count() - returns number of objects attached to the cells of the grouped rows.

Avg

- Calculates arithmetical average of arguments. It can use any number of arguments of any ranges. Null arguments are not used.

Off

- Returns a cell value, specified by a relative index. The index format is:

Off(row; column)

For example:

Off(-1;2) - returns the cell value located one row above and two columns to the right of the current cell.

Cell

- Returns the cell value specified by an absolute index.

Merge (Cells,Expression)

- Merges the Cells in a range. If the Expression is not equal to zero, it returns the Expression value.

For example:

=merge(A5:C5; "Name") – merges cells from A5 to C5 and in the results cell, the “Name” text is displayed.

SetHeight()

– Specifies the column height. Height value is specified in brackets.

Val()

- Calculated argument.

For example:

=val("A"+"1") - calculates "A1", and uses it as an expression (value in A1 cell). If argument is not a row, it is returned. =val(10+2) – is the same as =10+2.

=val("summ(A"+Str(off(0;-1))+":D"+Str(off(0;-1))+")") - sum of cells from A to D of row, whose number is in the cell to the left of the current one. In general, you can do without val. It is needed when you have to enter a cell address in user form to take the value from it further. Create the Addr variable, attach it to the input field in the form and enter in the table: =val(Addr). Function allows recurrence: =val(val("A"+"1")) - takes its value from the cell whose address is in cell A1. Number of enclosures is limited to 64.

Geometry(Object)

- Works as Attach object . The height of the attached object is fitted to the cell height. The object is taken from the report and attached to the cell.

SUMM(Section(-1))

- Sum of the current column’s cells in the section, following after the current section.

COUNT(Section(A3))

- Number of rows in the section containing cell A3.

Reserved variables:

Pi

- Pi character.

Row

- Returns the row number for every cell (rows are numbered from 1, the header row is not numbered).

Col

- Returns the column number for every cell (column “A” is number 1).

Object

- Returns the object type, attached to row cells.

Object1, Object2, …

- Objects attached to the cell.

Title

- Table name.

RowCount

- General number of rows.

ColCount

- General number of columns.

Info: NanoCAD is an easy-to-use, affordable, and yet professional, CAD platform for Windows, that provides an outstanding user experience by providing top-level performance, full capability, a classic interface and native.dwg format support. nanoCAD has been built to deliver design and project documentation for all industries. nanoCAD includes a full suite of basic and advanced CAD tools for 2D/3D design and creating industry-standard DWG-compatible CAD files. Our program ensures creative, collaborative and customizable features to enhance your efficiency, and includes a few API's, allowing anything from routine task automation to complex CAD software development. You may download nanoCad for free, using the links below, and purchase later, if you like it.