I am using the following routine to get a binding box that is used by several other routines.
This issue I have is that it creates a box aligned to the world ucs and not the current ucs. Is there a way to modify this make it work in the current UCS?
(defun boundxs (s / j oj minpoint maxpoint p q lower upper ptlist xlist ylist)
(vl-load-com)
(setq j -1)
(repeat
(sslength s)
(setq oj (vlax-ename->vla-object (ssname s (setq j (1+ j)))))
(vla-getboundingbox oj 'minpoint 'maxpoint)
(setq p (trans (vlax-safearray->list minpoint) 1 0)
q (trans (vlax-safearray->list maxpoint) 1 0)
ptlist (append ptlist (list p q)))
)
(setq
xlist (vl-sort ptlist (function (lambda (e1 e2) (< (car e1) (car e2)))))
ylist (vl-sort ptlist (function (lambda (e1 e2) (< (cadr e1) (cadr e2)))))
lower (trans (list (caar xlist) (cadar ylist) 0.0) 0 1)
upper (trans (list (caar (reverse xlist)) (cadar (reverse ylist)) 0.0) 0 1 ) ) (list lower upper)
)