GetBoundingBox Method

Back to Methods Reference

Gets two points of a box enclosing the specified object.

Signature

VBA : object.GetBoundingBox MinPoint, MaxPoint

VL : (vla-GetBoundingBox object MinPoint Maxpoint)

(vla-GetBoundingBox obj 'minpoint 'maxpoint)

  • Object : All Drawing Objects, AttributeReference
    The object or objects this method applies to.

  • MinPoint : Variant (three-element array of doubles); output-only
    The 3D WCS coordinates specifying the minimum point of the object's bounding box.

  • MaxPoint : Variant (three-element array of doubles); output-only
    The 3D WCS coordinates specifying the maximum point of the object's bounding box.

Remarks

The corners are returned in WCS coordinates with the box edges parallel to the WCS X, Y, and Z axes.

Example :


(defun c:al-getboundingbox ()

(vl-load-com)

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

(vla-GetBoundingBox obj 'minpoint 'maxpoint)

;minpoint contains the minimum point of the bounding box
;maxpoint contains the maximum point of the bounding box

(princ minpoint)
(terpri)
(princ maxpoint)

(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