Examining the Gp:getPointInput Function

Examining the Gp:getPointInput Function

When you ran the gp:getPointInput function, control was automatically passed from Visual LISP to AutoCAD. You responded
to three prompts, after which control was passed back from AutoCAD to Visual LISP,
and a T symbol displayed in the Console window.

Within the program, here is what happens:

  1. Visual LISP waits for you to pick the first point.
  2. 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.
  3. 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.
  4. When you pick an endpoint, the point value is stored in the Endpt variable.
  5. The result of this statement is examined by the next if statement, and control is passed to the getdist function.
  6. 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.
  7. 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.

You need some way to return values from one function to another. One way to do this
is to create a list of the values retrieved from gp:getPointInput, as highlighted in the following code:

(defun gp:getPointInput ( / StartPt EndPt HalfWidth )
  (if (setq StartPt (getpoint "
Start point of path: "))
     (if (setq EndPt (getpoint StartPt "
Endpoint of path: "))
       (if (setq HalfWidth (getdist EndPt "
half-width of path: "))
         (list StartPt EndPt HalfWidth)

Copy this version of gp:getPointInput into the Console window and press Enter. Here’s an opportunity to try another feature
of the Console window.

To use the Console window history feature to run gp:getPointInput

  1. Press Tab.

    This invokes the Console history command, cycling through any commands previously
    entered in the Console window. If you go too far, press Shift+Tab to cycle in the
    other direction.

  2. When you see (gp:getPointInput) at the Console prompt, press Enter to execute the function once again.
  3. Respond to the prompts as before.

The function returns a list containing two nested lists and a real (floating point)
value. The return values look like the following:

((4.46207 4.62318 0.0) (7.66688 4.62318 0.0) 0.509124)

These values correspond to the StartPt, EndPt, and HalfWidth variables.

Learning AutoCad

v 5, 2010 For a brief time in the mid‐1970s Desmond Nuttall was Secretary to a Certificate in Secondary Education (CSE) Examining Board. Desmond …… Determine which database performance tools best mitigate bottlenecks. … What do the different database performance tools offer? … To help you determine which tool or tools your organization needs, let's review the primary features and functionality that should be examined for each …Examine each function for relative extrema and saddle points. /(x, y) = x2 – y2 + 4x – 4y – 8. Solution Step 1: The first step in this problem is to find critical points for  …Functions & Services to the Public. In Ghana , the West African Examination Council conducts the terminal examinations for all pupils and students at the …function, i.e. as a functional feature, even where only one example of the feature has been given in the …

درباره نویسنده

بنده سیامک دوستداری فارغ التحصیل رشته مکانیک سنگ از دانشگاه صنعتی اصفهان هستم، و در این وبسایت آموزش های مربوط به نحوه برنامه نویسی در اتوکد و هچنین آموزش تصویری دستورات اتوکد را قرار خواهم داد.

تلفن همراه: ۰۹۰۰۱۲۳۴۴۴۴

ایمیل: s.doostdari@gmail.com

ترفند های اتوکد

نظرات کاربران