The file gppoly.lsp contains a number of functions required for straightening a polyline when a single grip has been stretched. Only some of these functions will be explained in depth in this tutorial.
The functions within the gppoly.lsp file are organized in a way that you may have noticed in other AutoLISP source code files. The highest-level function, often the main, or C: function (in this case, gp:Redefine-PolyBorder), is located at the bottom of the file. The functions called within the main function are defined above it within the source file. This convention goes back to the old days of programming, when some development environments required that files be organized this way. With Visual LISP, this is a matter of personal style; there is no requirement that you organize your functions in any specific sequence.
Before diving into the details, step back and look at what needs to be done to recalculate and draw the garden path boundary. The following illustration shows an example of a garden path, along with the association list key points stored in the reactor data:
In this example, the 12 key point is the lower-left corner, 13 is lower-right, and so on. If the user moves the upper-right point (the 14 key point), the program will need to recalculate two existing points—the lower-right (13) and upper-left (15).