GetEntity Method

Back to Methods Reference

Gets an object interactively.

Signature

VBA : object.GetEntity Object, PickedPoint[, Prompt]

VL : (vla-GetEntity Object Object PickedPoint Prompt)

(vla-getentity util 'obj 'ip "\nSelect Object: ")

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

  • Object : Object; output-only
    The picked object. Can be one of any of the Drawing Objects.

  • PickedPoint : Variant (three-element array of doubles); output-only
    A 3D WCS coordinate specifying the point that was selected.

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

Remarks

This method requires the AutoCAD user to select an object by picking a point on the graphics screen. If an entity is picked, it is returned in the first parameter and the second parameter will contain the point picked in WCS coordinates. If the pick point is not on an entity the call will fail.

The pick point returned by GetEntity does not necessarily lie on the selected object. The returned point represents the location of the crosshairs at the time of selection. The relationship between this point and the object varies depending on the size of the pickbox and the current zoom scale.

This method can retrieve an entity even if it is not visible on the screen or if it is on a frozen layer.

Example :


;get a reference to the Utilities Object :

(setq util (vla-get-utility 
                   (vla-get-activedocument 
                        (vlax-get-acad-object))))
                        
(vla-getentity util 'obj 'ip "\nSelect Object: ")

The reference to the Object is stored in the variable "obj"
and the pickpoint is stored in variable "ip" in the form of a safearray.
 
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