GetCorner Method

Back to Methods Reference

Gets a corner of a rectangle.

Signature

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

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

(vla-GetCorner util pt1 "\nSecond Corner : ")

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

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

  • 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 representing the corner of the rectangle.

Remarks

AutoCAD pauses for user input of the corner of a rectangle, and sets the return value to the value of the selected point. The Point parameter specifies the base point of the rectangle in the 3D WCS coordinates; this parameter is required. The Prompt parameter specifies a string that AutoCAD displays before it pauses. The prompt is optional.

The AutoCAD user can specify the corner by entering a point in the WCS coordinate format; GetCorner treats Point as a three-dimensional point. The user can specify the corner also by specifying a location on the graphics screen. AutoCAD draws a dynamically sized rectangle from Point to the current crosshair position to help the user visualize the location of the second corner. The rectangle is drawn in the XY plane of the WCS. When the pointing device is used, GetCorner ignores the Z field of Point and sets the Z field of result to the current elevation.

Example :


(defun c:al-getcorner ()

(vl-load-com)

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

(setq cnr (vla-GetCorner util pt1 "\nSecond Corner : "))

(princ pt1)

(terpri)

(princ cnr)

(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