point doesnt joins the selSet

point doesnt joins the selSet

diegolopezsilanes
Advocate Advocate
733 Views
1 Reply
Message 1 of 2

point doesnt joins the selSet

diegolopezsilanes
Advocate
Advocate

Hi again, Im trying to select the two closer points to another in a selection set, and something wrong when adding the second point to a selection set on the subfunction . I dont know why the second

(defun minusLenth (s ss2)
(repeat (setq i (sslength s))
(setq i (1- i)
n (ssname s i)
d (setq d (distance c (cdr (assoc 10 (entget n)))))
)
(if l 
(and (< d l)
(setq l d
o n
)
)
(setq l d)
)
)
(setq ss2 (ssadd o ss2))
)

(defun c:86 ()
;; Tharwat - 27.May.19 ;;
(setq ss2 (ssadd))
(setq s nil)
(setq p nil)
(princ "\nSelect point objectSSSS :")
(if 
(and 
(setq s (ssget '((0 . "POINT"))))
(setq p (ssname s 0))
(setq e p
c (cdr (assoc 10 (entget e)))
s2 (ssdel e s)
)
) ;and
(minusLenth s2 ss2)
)
(setq s3 (ssdel (ssname ss2 0) s2))
(minusLenth s3 ss2)
(sssetfirst ss2 ss2)
(princ)
)
 


Thanks as always

0 Likes
Accepted solutions (1)
734 Views
1 Reply
Reply (1)
Message 2 of 2

diegolopezsilanes
Advocate
Advocate
Accepted solution

it was a sintaxis mistake

0 Likes