Defining Macros

One of the more advanced features in Kig is its support for macros. This allows you to define new types of objects from other ones which are defined already.

For example: Suppose you want to make a macro for constructing a circle from three points on it. You would input three points, then construct some perpendiculars and midpoints until you find the center. Now you can use the existing Circle by Center & Point command (using one of the three points as the point for this command). The following image should make this a bit more clear:

Test running macros

Next comes defining the macro. Select the TypesNew Macro... menu item, or click on the   New Macro... button on the toolbar. A wizard will appear and ask you to select the given objects. In our example, these are the three points. Select the three points (click on them to select, click again to unselect) and click the Next button to continue. Finally, select the last objects (only the circle in our example).

The macro wizard

After the previous steps are completed, click the Next button to continue. Enter a name and optionally a description for your new type, and click the Finish button. Your macro type is now finished.

To use the new macro type, click its button on the toolbar or use the Objects menu. Constructing a macro object is just like constructing any other object.

Using your new type