gp:getPointInput function you created in Lesson 1:Refer to the
(defun gp:getPointInput ()
"Function gp:getPointInput will get user drawing input"
;; For now, return T, as if the function worked correctly.
So far, the function does not do much work. You will now begin to build on it by adding functions to get input from the user, which will define the start point, endpoint, and width of the path.
It is a good practice when creating AutoLISP programs to emulate the behavior of AutoCAD. For this reason, instead of asking the user to indicate the width by selecting a point in the drawing in respect to the centerline of a linear shape, your program should ask for a selection of the half-width.
gp:getPointInput function is complete, the variables, as well as the values assigned to them, will no longer exist. Therefore, you will store user-supplied values in local variables. Here's what the function might look like:Once the
(defun gp:getPointInput (/ StartPt EndPt HalfWidth)
(if (setq StartPt (getpoint "\nStart point of path: "))
(if (setq EndPt (getpoint StartPt "\nEndpoint of path: "))
(if (setq HalfWidth (getdist EndPt "\nhalf-width of path: "))
defun statement that begins the function. The first call to getpoint prompts the user to indicate a start point. The endpoint is then acquired in relation to the chosen start point. While selecting the endpoint, the user will observe a rubber-band line extending from the start point. Similarly, while setting the half-width value, the user will view another rubber-band line, this time representing distance, emanating from the endpoint.The local variables are declared following the slash character, in the