GetPoint Method

Back to Methods Reference

Gets the point selected in AutoCAD.

Signature

VBA : RetVal = object.GetPoint([Point][, Prompt])

VL : RetVal = (vla-GetPoint object Point Prompt)

(vla-GetPoint util nil "\nFirst Point : ")

  • Object : Utility
    The object or objects this method applies to.

  • Point : Variant (three-element array of doubles); input-only; optional
    The 3D WCS coordinates specifying the relative base point.

  • Prompt : Variant (string); input-only; optional
    The text used to prompt the user for input.

  • RetVal : Variant (three-element array of doubles)
    The 3D WCS coordinates of the point the AutoCAD user has selected.

Remarks

AutoCAD pauses for user input of a point, and sets the return value to the value of the selected point. The Point parameter specifies a relative base point in the WCS. The Prompt parameter specifies a string that AutoCAD displays before it pauses. Both Point and Prompt are optional.

The AutoCAD user can specify the point by entering a coordinate in the current units format; GetPoint treats the Point parameter and the return value as three-dimensional points. The user can specify the point also by specifying a location on the graphics screen. If the Point parameter is provided, AutoCAD draws a rubber-band line from Point to the current crosshair position.

The coordinates of the point stored in the return value are expressed in terms of the WCS.

If a keyword is returned instead of a point, AutoCAD will generate the error message "User input keyword." Use the GetInput method to obtain the keyword from the return value.

Example :


(defun c:al-getpoint ()

(vl-load-com)

(setq util (vla-get-utility 
                   (vla-get-activedocument 
                        (vlax-get-acad-object))))
                        
(setq thepoint (vla-GetPoint util nil "\nFirst Point : "))

(princ thepoint)

(princ)

);defun

 
The AutoLisp/Visual Lisp/VBA Resource Website
Google
Search the WWW Search AfraLisp

Copyright © 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website