Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, Im trying to join with lines the 2 closer points to another from a selection set , the code is not working, the third point does not correspond to the third point in distance to the initial point. the line ends do not correspond with the second one, which is supposed to be closer. and i dont find the mistakes.
thanks
(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) ; ) (if (= p2 nil) (setq p2 (cdr (assoc 10 (entget o)))) (setq p3 (cdr (assoc 10 (entget o)))) ) ) (setq ss2 (ssadd o ss2)) ) ; 18:32 12/06/2019 ; 18:44 16/06/2019 ; (defun c:Test (/ p s e c i n d l o) (defun c:86 () ;; Tharwat - 27.May.19 ;; (setq ss2 (ssadd) ) ; (setq ss2 nil) ;;;;;;;;;;;;;;;;;;;, (setq s nil) (setq p nil) (setq p2 nil p3 nil) (princ "\nSelect point objectSSSS :") (if (and (setq s (ssget '((0 . "POINT")))) (setq p (ssname s 0)) (setq p1 (cdr (assoc 10 (entget p)))) (setq e p c (cdr (assoc 10 (entget e))) s2 (ssdel e s) ) ) ;and (minusLenth s2 ss2) ; (setq ss2 (ssadd o ss2)) ) (setq s3 (ssdel (ssname ss2 0) s2)) (minusLenth s3 ss2) ; (command "_.Pline" p1 "GR" "0" p2 p3 P1 "") (command "linea" p1 "0,0" "") (command "linea" p1 p2 p3 p1 "") (sssetfirst ss2 ss2) (princ) )
Solved! Go to Solution.