Using the Universal Note in nanoCAD Construction

Use the Universal Note to pull information from a drawing and build schedules and specifications, even if you have never programmed before.

In nanoCAD Construction, a Universal Note can read properties from other objects in the drawing and display them as an annotation.

One of my favorite parts of the job is talking to engineers who already use nanoCAD. Once they’ve mastered lines and blocks, they start asking how to speed up their drawings and make them more consistent. The question I hear most is, ‘How can I automate this?’

I usually start with familiar CAD tools such as applications and fields. Then I show what nanoCAD can do with the drawing itself. It can pull object properties into a report table or link a note to data from a particular drawing object.

For Construction users I also recommend the Object Wizard and the Universal Note. The wizard lets you program smart objects. The note offers a simpler way to get many of the same benefits.

You can build a note without programming. We’ll create one that displays fire and explosion hazard categories. The example follows Russian drawing conventions, but the same method works for other kinds of annotation.

Universal Note in nanoCAD Construction

The note will read and calculate object properties, offer several display variants and have its own data-entry dialog. We’ll also connect it to a nanoCAD report table so the table updates automatically.

Preparing the note

Draw three versions of the note using lines and text.

Three display variants for the note

Text beginning with $ becomes a note attribute that you can edit and reuse.

  • $sEX — explosion risk

  • $sINC — fire risk

  • $sTe — temperature

  • $sHu — humidity

Creating the note

Run SPCREATEUMARKER or choose Add Marker.

Add Marker button

Select the text and other drawing elements. Set the insertion point at the midpoint of the diagonal.

Selecting text and other drawing elements

The Create Marker dialog opens.

Create Marker dialog

In MarkerType, enter the name you want to see in the parts library and the Properties panel. Add a description for each attribute identified by a $ prefix, then save the note to the library.

Create Marker dialog

The note is now ready to use.

Note in the parts library

Adding display variants

In the Create Universal Note dialog box, click the Add Implementation icon.

Add Implementation

Give the new variant a name.

New display variant

Select the template you drew for the second variant and set its insertion point.

Second note variant

Create var3 the same way. Each of the three variants displays a different set of attributes.

Third note variant

Reading properties from other objects

Link the note to a Space object by adding two attributes: rNumber for the room number and rArea for its area. Choose Add property from object for each.

The note supports three kinds of links between an attribute and an object property.

With a one-way link, a change to the object updates the note.

With a two-way link, you can edit either the note or the object and the other updates.

With a basic link, you edit the object property through the note.

This note reads its properties from a Space object. Draw one before setting up the links.

Draw four walls with SPWALLADD or Add Wall, then use the Room command to create a room.

Room in nanoCAD

Select the note, then choose Edit Marker Properties.

Edit Marker Properties

Add an attribute called rNumber for the room number. Click the ellipsis button and choose Add property from object.

Add property from object

Select the room in the drawing and choose Number from its property list. The default link is one-way.

Add property from object

To edit the room number from the note as well, right-click the link type icon and choose the two-way option.

Add property from object

Add a second attribute called rArea. Link it to the room’s area and keep the default one-way link.

Add property from object

Save the note to the parts library.

 Calculated attributes

A calculated field can combine attribute values with text. These are the elements we’ll use in an expression.

{ } — enclose the expression.

+ — joins values in the expression.

" " — enclose literal text.

Function() calls a function from the nanoCAD table expression editor. Note attributes can serve as its arguments.

We’ll append °C to the temperature value and % to the humidity value.

 Calculated attributes

Add sTeField and sHuField to store the numeric values entered in the dialog. The displayed attributes, sTe and sHu, will read these fields.

Set sTe and sHu to Calculated field.

 Calculated attributes

For sTe enter {string(sTeField)+"°C"}. For sHu enter {string(sHuField)+"%"}.

 Calculated attributes

Enter 18 and 60 in the two input fields. The drawing now displays 18°C and 60%.

 Calculated attributes

Add rAreaInt for the area in square meters. It will feed a report table later. In Value enter {Int(rArea*100)/100} {FmtText("m",FmtSuper("2"))}.

Int truncates to an integer. Multiplying by 100 before truncation and dividing by 100 afterward retains two decimal places.

FmtText controls text formatting, including superscripts and subscripts. It can format a single unit symbol, such as the ² in m², or a whole string. 

For the complete function list, see the nanoCAD user manual.

Finally, add the system attribute mcDefLayer to set the layer for the note. Create a layer named Markers in Layer Manager, then enter that name as the attribute’s value. 

 Calculated attributes

Creating a custom dialog for the note

You can give a Universal Note its own data-entry form. The form editor offers several ways to display and edit attributes.

  • Tables embedded in the note

  • Tables from other Universal Notes and parametric objects

  • Checkboxes (checkBox)

  • Radio buttons (radioButton)

  • Text fields (editBox)

  • Lists, including lists populated from a database (listBox)

  • Combo boxes, including those populated from a database (comboBox)

The custom dialog is optional. It can make the note easier to use when several attributes need to be filled in at once.

You can lay out the form in the editor without writing any code.

Open the Universal Note for editing and click Show Form Editor.

nanoCAD custom form

Start with controls for the four attributes displayed on the drawing: sEX, sTe, sHu and sINC.

In Fields, hold Ctrl and drag Explosion Risk (sEX) onto the form.

nanoCAD custom form

The sEX attribute has four possible values, A, B, C and D. Choose a combo box for this field.

Select the white field. In Properties, find Data, click the ellipsis and enter the four choices. Press Ctrl+Enter when you’re done.

nanoCAD custom form

Repeat those steps for Fire Risk (sINC), using the values P-1 through P-4.

nanoCAD custom form

Choose Edit controls for sTeField and sHuField so the user can enter a numeric value.

nanoCAD custom form

Now add a way to switch between the note’s display variants.

Add radio buttons to switch the value of mcImplementation and select the display variant shown in the drawing.

Choose Radio button and click where you want it on the form.

Selecting a note variant in the custom dialog

In Field Name, select mcImplementation. Set its value to Main for the note’s first display variant.

Selecting a note variant in the custom dialog

Copy and paste the radio button twice, then adjust the captions and values for var2 and var3.

Selecting a note variant in the custom dialog

Save and test the note. Switching radio buttons should change its appearance in the drawing. Editing a field should update the value the note displays.

Selecting a note variant in the custom dialog

Universal Notes and nanoCAD tables

A nanoCAD report table can collect all the notes in the drawing. It can display their attributes and let you edit the linked values directly in the table.

Draw a floor plan with several rooms and place a note in each one.

Universal Notes and nanoCAD tables

Create a six-column nanoCAD table titled “List of fire safety categories” and place it in the drawing.

Universal Notes and nanoCAD tables

Double-click the table to edit it, then insert a report section.

Universal Notes and nanoCAD tables

Under Report Template, open the object filter and select the fire and explosion hazard note you created.

Universal Notes and nanoCAD tables

Right-click a cell to list the note’s properties and attributes. Select the ones you want in the table.

Universal Notes and nanoCAD tables

Choose Group and Merge to group the table by room number in column A.

Universal Notes and nanoCAD tables

Delete any unused rows from the table.

The table now lists the fire safety category for each room.

Universal Notes and nanoCAD tables

When the drawing changes, the report updates. For values with two-way links, editing the table also updates the note in the drawing.

This sample note illustrates the method. For a project deliverable, build the note to match the applicable drawing standards.

Conclusion

With a Universal Note, you can build an annotation that reads, calculates and displays drawing data without writing code. Link it to a nanoCAD table and the same information can also populate schedules and specifications.

Try nanoCAD with your own projects

Open your own DWG files and see how nanoCAD fits into your work.

Start your free 30-day trial

Related articles

View all articles