Menu

Extension of the menu functionality in nanoCAD 8.5: macros and LISP expressions

Extension of the menu functionality in nanoCAD 8.5: macros and LISP expressions.

The nanoCAD menu files have the .cfg extension and a structure different from the menu structure (*.mnu, *.cui, *.cuix) of other CADs. In the 8.5 version, the support of macros has been added that can include several commands and parameters, as well as LISP expressions.

Complex macro in the menu

As an example, let’s write a single-item drop-down menu MyTest.cfg (with the Notepad text editor) that creates a round hole of radius 500 in the center point 700,600 in a drawing with the CIRCLE command. The dialog in the command line of such macro is shown in Fig. 1. The user must click on the menu item only one time without the need to enter any other data.

LISP expressions in the menu

Processing LISP expressions in the command line is another step forward in nanoCAD 8.5. At the same time, it is possible to include LISP expressions in the macro menu.

For example, let us write another variant of the menu (MyTest2.cfg), but already including three items that implement creating round holes in the drawing using the CIRCLE command. The commands must run through LISP expressions. The menu items will differ only in their radius values (100, 200, and 300). There, the hole center point will be requested using a pause (the PAUSE LISP symbol). At the same time, let us complicate the menu items adding a standard icon of the CIRCLE command. The system icons are in the newbtns.dll file which is part of the nanoCAD software. The icon name is the same as the command name.

Read more...

Last news