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.
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.
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.
Select the text and other drawing elements. Set the insertion point at the midpoint of the diagonal.
The Create Marker dialog opens.
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.
The note is now ready to use.
Adding display variants
In the Create Universal Note dialog box, click the Add Implementation icon.
Give the new variant a name.
Select the template you drew for the second variant and set its insertion point.
Create var3 the same way. Each of the three variants displays a different set of attributes.
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.
Select the note, then choose Edit Marker Properties.
Add an attribute called rNumber for the room number. Click the ellipsis button and choose Add property from object.
Select the room in the drawing and choose Number from its property list. The default link is one-way.
To edit the room number from the note as well, right-click the link type icon and choose the two-way option.
Add a second attribute called rArea. Link it to the room’s area and keep the default one-way link.
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.
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.
For sTe enter {string(sTeField)+"°C"}. For sHu enter {string(sHuField)+"%"}.
Enter 18 and 60 in the two input fields. The drawing now displays 18°C and 60%.
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.
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.
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.
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.
Repeat those steps for Fire Risk (sINC), using the values P-1 through P-4.
Choose Edit controls for sTeField and sHuField so the user can enter a numeric value.
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.
In Field Name, select mcImplementation. Set its value to Main for the note’s first display variant.
Copy and paste the radio button twice, then adjust the captions and values for var2 and var3.
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.
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.
Create a six-column nanoCAD table titled “List of fire safety categories” and place it in the drawing.
Double-click the table to edit it, then insert a report section.
Under Report Template, open the object filter and select the fire and explosion hazard note you created.
Right-click a cell to list the note’s properties and attributes. Select the ones you want in the table.
Choose Group and Merge to group the table by room number in column A.
Delete any unused rows from the table.
The table now lists the fire safety category for each room.
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.


