TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Amsterdammed on July 02, 2010, 02:21:59 PM
-
Hello there,
error catchin never was my game. now it bites me.
I use that code
(defun ax:GetBoundingBox (ent / ll ur)
(if ent
(progn
(vl-load-com)
(vla-getboundingbox (vlax-ename->vla-object ent) 'll 'ur)
(mapcar 'vlax-safearray->list (list ll ur))
) ;_ end of progn
;_ end of defun
) ;_ end of if
)
to find out the actual size of an section created by an vertical we work with, but there seem to be entities with null extents
Automation Error. Null extents
how can i alter my code so that it doesn't crash anymore?
-
What kind of entity you're using for test?
-
For more info see these:
http://www.theswamp.org/index.php?topic=15323.msg188915#msg188915
http://www.theswamp.org/index.php?topic=15323.msg190278#msg190278
http://forums.augi.com/showpost.php?p=902301&postcount=2
http://www.theswamp.org/index.php?topic=32597
http://www.theswamp.org/index.php?topic=20534.msg250025#msg250025
-
Alan's posted some really nice examples, but here's one that SHOULD catch the possible errors from vla-getboundingbox...
(defun BBox (ent / ll ur)
(if (eq (type ent) 'ENAME)
(if (not (vl-catch-all-error-p
(vl-catch-all-apply
(function vla-getboundingbox)
(list (vlax-ename->vla-object ent) 'll 'ur)
)
)
)
(mapcar (function vlax-safearray->list) (list ll ur))
)
)
)
-
Thanks!!
That works!
Bernd
-
Good deal. :)