Copy, Paste, and MacrosCopy, Paste and MacrosThe macro concept of Cinderella differs a little from macros available in other geometry software. We describe ways of using the macro capabilities below.Copy/PasteThe easiest way to create a macro on the fly is to use the copy/paste actions. If you select several elements using the Move Mode and choose Edit/Copy from the menu (or the equivalent keyboard shortcut), Cinderella will copy the selected elements to the clip board. Additionally, intermediate construction steps that define the relations between the selected elements will be copied as hidden elements. When you paste the elements, these hidden elements will be pasted as well, and as a consequence the pasted elements will behave as they did before. Here is an example. Start by using Add a Circle twice to create two points A and B and two circles that use A and B as center and B and A as point on the circle. Next, use the Add a Line tool to add the perpendicular bisector of A and B. Now, switch to Move Mode, press shift to add to the selection, and click A and B. The three selected elements, A, B and the line a, can now be copied to the clipboard using the menu or the keyboard shortcut (CMD-C on the Mac or Ctrl-C on Windows). Open a new Cinderella window (CMD-N or Ctrl-N) and paste the clipboard data. You will see points A and B and the line a. The circles are added as hidden elements — you cannot see or use them, but they are used to determine the position of line a. You can verify this by moving A and B — the line will behave as perpendicular bisector of A and B. RedefineWhat if you want to create the three perpendicular bisectors of a triangle? The solution above shows you how to speed up the creation of three perpendicular bisectors, but pasting the bisector construction three times is not satisfactory: Note that you end up with three bisectors of three points of pairs (it's nice to know, though, that the pasted points have been renamed and moved a little). This is the time when the Redefine Point mode is useful. Switch to this mode and move A' to A, B' to B, A'' to A, B'' to C, A3 to B, and B3 to C. The pasted points will be identified with the existing triangle points and you will end up with a proper construction containing only the triangle and its edge bisectors. Creating own ToolsWorking with copy/paste addresses most cases of repeating steps in a construction. If you want to use several partial constructions, you can also use a convenient way to create a new tool: Just use "Edit/Create Tool from Selection" after you selected the elements that define the new tool. Using the bisector example from above, we get the following dialog, where we can add a name and description for this tool. The icon is created automatically! After you confirm the creation of the tool, it will be available in the toolbar. The tools you created can be saved to a file and loaded in other constructions using the corresponding menu entries in the Scripting menu.
Contributors to this page: Richter
and
Kortenkamp
. The content on this page is licensed under the terms of the License. |
Login |