
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm trying to compare the results of
a minimum or maximum apply
with
the fisrt position of a list that is the (car of a coordinate given by inters command)
the values are the same but the results are always nil for both expressions
(if (= xMax1 (car pts1234)) (progn (setq x1(/ (+ xMin1 (car pts1234)) 2.00)) ))
(if (= xMin1 (car pts1234)) (progn (setq x1(/ (+ xMax1 (car pts1234)) 2.00)) ))
what is wrong?
the important part of the code and the results
_$ (setq pt1 (cdr (assoc 10 (entget ocd_line)))) ; 1
(-184.619 265.883 0.0)
_$ (setq pt2 (cdr (assoc 11 (entget ocd_line))))
(-145.645 265.883 0.0)
_$ (setq xl1 (list (car pt1) (car pt2)))
(-184.619 -145.645)
_$ (setq xMax1 (apply 'max xl1))
-145.645
_$ (setq xMin1 (apply 'min xl1))
-184.619
_$ (setq yl1 (list (cadr pt1) (cadr pt2)))
(265.883 265.883)
_$ (setq yMax1 (apply 'max yl1))
265.883
_$ (setq yMin1 (apply 'min yl1))
265.883
_$ (setq pt3 (cdr (assoc 10 (entget obc_line))))
(-184.619 294.473 0.0)
_$ (setq pt4 (cdr (assoc 11 (entget obc_line))))
(-184.619 265.883 0.0)
_$ (setq xl2 (list (car pt3) (car pt4)))
(-184.619 -184.619)
_$ (setq xMax2 (apply 'max xl2))
-184.619
_$ (setq xMin2 (apply 'min xl2))
-184.619
_$ (setq yl2 (list (cadr pt3) (cadr pt4)))
(294.473 265.883)
_$ (setq yMax2 (apply 'max yl2))
294.473
_$ (setq yMin2 (apply 'min yl2))
265.883
_$ (setq pts1234 (inters pt1 pt2 pt3 pt4))
(-184.619 265.883 0.0)
_$ (if (= xMax1 (car pts1234)) (progn (setq x1(/ (+ xMin1 (car pts1234)) 2.00)) ))
nil
_$ (if (= xMin1 (car pts1234)) (progn (setq x1(/ (+ xMax1 (car pts1234)) 2.00)) ))
nil
xMin1 and (car pts1234) has the same value as follow
_$ (car pts1234)
-184.619
_$ xMin1
-184.619
should be something like that: (if (= -184.619 -184.619) (progn (setq x1(/ (+ xMax1 (car pts1234)) 2.00)) ))
Why is not returning TRUE to the sentence to execute the x1 calculation??? (if (= xMin1 (car pts1234)) (progn
Because the x1 remains ZERO as set before
_$ x1
0
Thanks in advance,
Luis
Solved! Go to Solution.