Do you struggle with your scripts not prompting you to pick a start point? If your answer is yes, macros are the solution for you.
You can use both scripts and macros to automate design tasks.
Scripts always start and end at the same coordinate, whereas a macro lets you start at a different coordinate each time you use it. Every action included in the macro takes place relative to the starting point.
A macro is a script that lets you automate a series of point selections and replay them, starting at another coordinate. When you replay a macro, the layout editor prompts you for a starting point (origin). The macro places the point selections you recorded relative to this starting point. This is useful in operations you must repeat on a board/design drawing, for example, repeating complex geometric operations.
For example, the following image shows two lines: one created while recording the macro and the other during replay.
To record a macro, select the Macro record mode check box, as shown below, and record just like a script.
The format of a macro file is shown below.
Notice the pick_origin and pick rel commands that ask for user input, and then run the other commands in the script.
Try recording macros when you want a sequence of commands to replay and ask you for the start point.