Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Binding Box and UCS

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
230 Views, 0 Replies

Binding Box and UCS

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)
)

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report