(defun MinBoxPts(ss / ent i maxp maxx0 maxy0 minp minx0 miny0 pmax pmin)
(if ss
(progn
(setq minx0 1e6 miny0 1e6 maxx0 -1e6 maxy0 -1e6 i -1)
(while (setq ent (ssname ss (setq i (1+ i))))
(vla-getboundingbox (vlax-ename->vla-object ent) 'minp 'maxp)
(setq minp (vlax-safearray->list minp) maxp (vlax-safearray->list maxp))
(setq
minx0 (min minx0 (car minp))
miny0 (min miny0 (cadr minp))
maxx0 (max maxx0 (car maxp))
maxy0 (max maxy0 (cadr maxp))
)
)
(setq pmin (list minx0 miny0) pmax (list maxx0 maxy0))
(list pmin pmax)
)
nil
)
)