Logically it should be but in reality it's NOT , cause I did not put them in order while gathering the needed information ( coordinates ) .
You are welcome hosyn Yes, you're right Tharwat... Your mapcar is looking in first sequence first items from both lists, and then second ones... Thanks, you corrected me, I overlooked... You're welcome Marko , it is my pleasure . Here's another way to write it:
(defun c:test ( / a b i m n s ) (if (setq s (ssget "_:L" '((-4 . "")))) (progn (repeat (setq i (sslength s)) (vla-getboundingbox (vlax-ename->vla-object (ssname s (setq i (1- i)))) 'a 'b) (setq m (cond ((mapcar 'min m (setq a (vlax-safearray->list a)))) ( a )) n (cond ((mapcar 'max n (setq b (vlax-safearray->list b)))) ( b )) ) ) (command "_.move" s "" "_non" (mapcar '(lambda ( a b ) (/ (+ a b) 2.0)) m n) "_non" '(10 10 0)) ) ) (princ))(vl-load-com) (princ) It is good to know that mapcar with either of min and max functions work on LISTS and return the predicate list if matched the criteria of course .
Thanks for the variation .
页:
1
[2]