Chapter 1: Macros & Command-Sequences
1 Macros & Command-Sequences
1.1 Command-line applications
Many programs are based on a command-line interface. This means you can use tools, createdata and change settings using only the keyboard. You type the commands and the programwill execute it:
Line 0,0,0 10,0,0
This system originated from
and thus it is no longer 'up to date’. Therefore practically allapplications we see today have a GUI (graphical user interface) that allows us to bypass thiscommand-line using the mouse: we click on the line button and then we pick 2 coordinatesin a viewport. However the line button is nothing more than a short-cut to the command-lineinterface. In most CAD applications the command-line is still visible. However other programssuch as PhotoShop or Illustrator no longer show the command-line on screen. They
tobe completely graphical...
Despite having a fully developed graphical interface, programs like PhotoShop still supportmacros. Macros are just a set of predefined commands:
_SelNone_Line w0,0,0 w10,0,0_SelLast_Line w10,0,0 w10,10,0_SelLast_Line w10,10,0 w0,10,0_SelLast_Line w0,10,0 w0,0,0_SelLast_Join
The above macro will add 4 lines to a 3D-scene in Rhino, select them all and join theminto a square. If we need to perform this action frequently, it would make sense to createa macro
so we can save time
. Macros are the first step towards scripting and-unfortunately- macros and scripts are often mixed up.The problem with macros is that they do not allow for variable execution and they cannotdeal with mathematical issues. I.E.
macros do not exist. They are always
.Macros are machines.