(DEFUN c:consolpt (/) (IF (SETQ allpline (SSGET "x" '((-4 . "") (-4 . "") (-4 . "AND>") ) ) ;_ end of ssget ) ;if there are any light-weight polylines (PROGN (SETQ proxwin (ureal 1 "" "Enter size of proximity window" proxwin)) (SETQ plsscnt (SSLENGTH allpline)) (SETQ stepcnt 0) (WHILE (< stepcnt plsscnt) (SETQ entdef (ENTGET (SSNAME allpline stepcnt))) ;examine each polyline (WHILE (SETQ entdef (MEMBER (ASSOC 10 entdef) entdef)) ;examine each point in each polyline (SETQ ipt (CDAR entdef) iptss (SSGET ;find all polylines having points within the specified no. of units of this test point "cp" (LIST (LIST (ATOF (RTOS (- (CAR ipt) (/ proxwin 2)) 2 4)) (ATOF (RTOS (- (CADR ipt) (/ proxwin 2)) 2 4)) ) ;_ end of list (LIST (ATOF (RTOS (+ (CAR ipt) (/ proxwin 2)) 2 4)) (ATOF (RTOS (- (CADR ipt) (/ proxwin 2)) 2 4)) ) ;_ end of list (LIST (ATOF (RTOS (+ (CAR ipt) (/ proxwin 2)) 2 4)) (ATOF (RTOS (+ (CADR ipt) (/ proxwin 2)) 2 4)) ) ;_ end of list (LIST (ATOF (RTOS (- (CAR ipt) (/ proxwin 2)) 2 4)) (ATOF (RTOS (+ (CADR ipt) (/ proxwin 2)) 2 4)) ) ;_ end of list ) ;_ end of LIST (LIST (CONS -4 "") (CONS -4 "") (CONS -4 "and>") ) ;_ end of list ) ;_ end of ssget ) ;_ end of setq (IF (>= (SSLENGTH iptss) 2) ;if there are 2 or more (this polyline is not alone here)... (PROGN ;make all their points exactly the same. (SETQ ptscnt 0) (WHILE (< ptscnt (SSLENGTH iptss)) (SETQ modedef (ENTGET (SSNAME iptss ptscnt))) (IF (EQ modedef (ENTGET (SSNAME allpline stepcnt))) nil (WHILE (SETQ modedef (MEMBER (ASSOC 10 modedef) modedef)) ;examine each point in each polyline (SETQ modipt (CDAR modedef)) (IF (AND (> (CAR modipt) (ATOF (RTOS (- (CAR ipt) (/ proxwin 2)) 2 4))) (> (CADR modipt) (ATOF (RTOS (- (CADR ipt) (/ proxwin 2)) 2 4))) (< (CAR modipt) (ATOF (RTOS (+ (CAR ipt) (/ proxwin 2)) 2 4))) (< (CADR modipt) (ATOF (RTOS (+ (CADR ipt) (/ proxwin 2)) 2 4))) ) ;_ end of and (PROGN ;;; (princ (strcat "\nintersection found at " ;;; (itoa stepcnt) ;;; "-" ;;; (itoa ptscnt) ;;; ) ;;; ) (SETQ newedef (SUBST (CONS 10 ipt) (CONS 10 modipt) (ENTGET (SSNAME iptss ptscnt)))) (IF (ENTMOD newedef) (PRINC (STRCAT "\nModified an intersection point at " (ITOA stepcnt) "-" (ITOA ptscnt))) (PRINC (STRCAT "\nIntersection point at " (ITOA stepcnt) "-" (ITOA ptscnt) " NOT modified!")) ) ;_ end of if ) ;_ end of progn ) ;_ end of if (SETQ modedef (CDR modedef)) ) ;_ end of while ) ;_ end of if (SETQ ptscnt (1+ ptscnt)) ) ;_ end of while ) ;_ end of progn (PRINC (STRCAT "\nNo intersection at " (ITOA stepcnt) "-" (ITOA ptscnt))) ) ;_ end of if (SETQ entdef (CDR entdef)) ) ;_ end of while (SETQ stepcnt (1+ stepcnt)) ) ;_ end of while ) ;_ end of progn (PRINC "\nNo LWPOLYLINE entities found! Nothing to do! ") ) ;_ end of if ) ;_ end of defun ;|«Visual LISP© Format Options» (120 2 15 2 T "end of " 100 9 2 0 nil nil nil T T) ;*** DO NOT add text below the comment! ***|;