When you ran the gp:getPointInput function, control was automatically passed from VLISP to AutoCAD. You responded to three prompts, after which control was passed back from AutoCAD to VLISP, and a T symbol displayed in the Console window.
- VLISP waits for you to pick the first point.
- When you pick the first point, the program stores the value of your selection (a list containing three coordinate values—an X, Y, and Z value) into the StartPt variable.
- The first if function examines the result to determine whether a valid value was entered or no value was entered. When you pick a start point, control is passed to the next getpoint function.
- When you pick an endpoint, the point value is stored in the Endpt variable.
- The result of this statement is examined by the next if statement, and control is passed to the getdist function.
- The getdist function acts in a similar fashion when you pick a point on the screen or enter a numeric value. The result of the getdist function is stored in the HalfWidth variable.
- Program flow reaches the T nested deeply within the function. No other functions follow this, so the function ends, and the value T is returned. This is the T you see at the Console window.
(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: "))
(list StartPt EndPt HalfWidth)
- Press TAB.
- When you see (gp:getPointInput) at the Console prompt, press ENTER to execute the function once again.
- Respond to the prompts as before.
((4.46207 4.62318 0.0) (7.66688 4.62318 0.0) 0.509124)