9-2 Chapter 9: Using the Macro Toolbox
Copying permitted provided TI copyright notice is included
© 1997, 1999 Texas Instruments Incorporated
How to create a macro
A macro constructs “final” objects based on “initial” objects. Intermediate objects are not
constructed. This feature allows easy construction of complex figures and is the primary method
for constructing fractals. You can save macros on disk for later use. Macros are automatically
saved with any file in which they are used.
To create a macro:
1.
Select the initial objects required to define the final object(s).
2.
Select the final object(s), and then, if necessary, change the attributes of the object(s) as they
will appear in the final construction.
3.
Define the macro for inclusion in the
Macro
toolbox. The macro is then available for use.
Read the following rules, and then refer to the step-by-step procedures that follow them.
Rules for creating macros
4
Initial objects must allow the construction of all final objects. Final objects must be
determined by the initial objects. A macro must respect the logical structure of the figure as it
was constructed.
4
An object cannot exist without the points that define it. For example, a triangle cannot exist
without its vertices. Therefore, when you select an object as an initial object, the macro is able
to refer to the points that define the object.
4
When you select
Define Macro
, a macro generates its final objects with the object’s existing
attributes. You can change these attributes during an intermediate step before you select
Define
Macro
. In this way, you can hide objects (using
Hide/Show
in the
Display
toolbox) that were
selected as initial objects.
4
Because macros are intended as general purpose construction tools, like those in the
Construct
toolbox, comments and labels cannot be defined as final objects. You can select
measurements and numerical values as final objects, but any text attached will not be
duplicated when the macro executes.
4
The location of an arbitrary point on an object is determined by a random-number generation.
Therefore, the position of the point will be uncertain if it is selected as a final object.
4
If the initial objects are different types (for example, lines and circles are different types), they
are not used in any order. If the initial objects are the same type, the macro uses them in the
order in which they were selected as initial objects.
4
The number of objects created by a macro is limited only by available system memory.
4
Macros are automatically saved with any construction in which they are used. You can also
save macros in a tool configuration file (see
Options
Menu
in the chapter "Using the Menus").
4
The first final object you select is considered the primary object of the macro. If a name is
entered in the
Name for first final object
field, it will be the cursor message when the cursor is in
the vicinity of the primary object. For the Macintosh, the
Name for first final object
field is found
under the
More
option in the
Macro
dialog box. For the Windows and DOS versions, the
Name for
first final object
field is already visible in the dialog box.
4
To save multiple definitions for a single macro, select the initial and final objects for the new
definition, and save it with the same name. The dialog box generated in
Define Macro
allows you
to select previous macros when saving a macro. For example, you may want to define a macro
that constructs a triangle with vertices at the midpoints of an initial triangle, a polygon with
vertices at the midpoints of a three-sided polygon, and a triangle with vertices at the midpoints
of a three-sided regular polygon. A single macro can perform all of these operations if each
case is identified with appropriate initial and final objects and saved to the same macro file.