Tutorials CadCraft help Walkthroughs
Buttons of your own (My tools)
Add toolbar buttons that run your own macros, give them shortcut keys, share them as a file, and bring buttons over from a CUIx customization file.
Written for CadCraft 0.5. The same help is inside the app: press F1.
What you will learn
How to put buttons of your own on the toolbar, each running a macro written the way AutoCAD writes them, how to give a button a key, and how to bring the buttons of a CUIx file over.
Add a button
- Open Settings (⌘,Ctrl+,) and stay on the CadCraft tab. Scroll to My tools.
- Click Add a button….
- Fill in the box:
- Group: the toolbar group it goes in, for example
My tools. A new name makes a new group. - Label: the words on the button.
- Macro: what it types, for example
^C^C_rectang;0,0;@100,50;. - Shortcut key: click the box and press the keys, for example ⌃⌥BCtrl+Alt+B.
- Icon: a PNG or SVG picture of at most 64 KB, or none (a star shows).
- Group: the toolbar group it goes in, for example
- Click Save.
The button appears at the end of the toolbar, in its group. Click it, or press its key, to run it. Edit and Delete in the list change or remove it.
Write a macro
A macro is what you would type at the command line, with a few signs:
| Sign | Means |
|---|---|
^C | Cancel whatever runs (^C^C is the usual start) |
; or a space | ReturnEnter |
\ | Wait for you: a click or a typed answer, then the macro carries on |
_ or . before a command | Accepted and ignored (international and built-in names) |
* at the very start | Run again each time it ends, until you press EscEsc |
^O, ^G | Turn Ortho, the grid on or off |
$M= | The rest is DIESEL. Only $(if,…), $(getvar,…), $(=,…) and $(eq,…) are read; a button using anything else says so and does nothing |
Examples:
^C^C_line;0,0;@100,0;;draws a 100-long line from the origin.^C^C_circle;\25;asks you for the centre, then draws a circle of radius 25 there.^C^C_turnrightturns the view 90° right.
Shortcut keys
A key needs ⌘Ctrl (Ctrl, or Cmd on a Mac) or ⌥Alt with a letter or digit, or one of the free function keys F2F2, F4F4, F5F5, F6F6, F9F9. Letters on their own go to the command line. Keys CadCraft, the app or the browser already use (such as ⌃SCtrl+S or ⌃ZCtrl+Z) and keys another button has are refused, and the box says why.
Share your buttons
- Export… saves every group and button (with icons and keys) as
my-tools.json. - Import… adds the groups of such a file after yours. A group name you already use gets "(2)"; a key that would clash is left off, and the panel says so.
Bring buttons over from a CUIx file
- Click Import CUIx… and choose the
.cuixfile.
Its toolbars and ribbon panels become groups, each button with its macro and its picture (PNG, or BMP turned into PNG). Its shortcut keys come in a group of their own, each button with its key; the command aliases it may carry come in an Aliases group. The panel lists what came over.
Good to know
- Buttons are kept in this browser (or this desktop app), not in drawings.
- A button runs through the command line, so it is undone like anything you type: one ⌘ZCtrl+Z per command it ran.