Create own commands, is that possible?
Answered
Good morning,
I'm working on a computer program, which can easily give output about the rectangles which are used. This output is given in the form of (bottom, left, top, right), which can ealisy be converted into the format (bottom, left)->(top, right). I would like to create a Geogebra command "Rectangle", using the mentioned points. My intention is to put this command in the "Input" box.
I could write a script for that, but it seems that using a script function in the "input" box is not possible (or at least I don't know how to do it).
For your understanding, the script function would look like:
- function Rectangle (b, l, t, r)
{
Polygon[(b,l), (b,t), (r,t), (r,b)];
}
Does anybody know how to do this?
Thanks
(Sorry, I have made one error in my description : the points, defining the rectangle, are of the form (left, bottom), and (right, top). (I've been mixing up X- and Y- coordinates)
Hi,
You can create your own tool http://www.geogebra.org/wiki/en/Tools_Menu. Once you have created your tool "Rectangle" its name can then be used as a command, as long as the tool is available in that ggb file.
If you need more information, just ask.
Simon
The added tool makes a rectangle from two points
https://ggbm.at/2418067
Thanks a lot, this was exactly what I was looking for.
A command-creating command, such as
Tool(toolname,inputlist,outputlist)
would be very useful.
It's possible to use a "parametric Execute"
on a "macro string list":
An example: ▶ http://tinyurl.com/exepar
Hi,
Thanks. Very interesting! Please give a simple example of implementation in a ggB file.
Comments have been locked on this page!