The code below is used to copy blocks to end of a line. Does anyone know how or what the code is to find only the dangle side of a line and not just the end. A dangle is a side of a line that ...dangles, meaning it does not intersect with another line. I'm going to use it for adding meters to my service laterals. If I run it now it will put the block on the end of every line even if it intersects with another line, and I do not need that. I did search around and find a SKI_NODE lisp that would test for dangles, but it does the same as this code, it hits every side of the line. Basically I need it to ignore the line if it intersects/touches or is within 0.5 distance of another line. Any ideas?
Thanks in advance,
Daniel
;;Block to end of line command
::Original by Gliderider and modified for blocks by cadmoogle
(defun dxf (code elist)
(cdr (assoc code elist))
);defun
(defun c:blockend ()
(setq bname (getstring t "\nName of block to copy: "))
(setq lset (ssget '((0 . "line"))) ;filter line in selection set
setlen (sslength lset) ;setq number of entties in selection set,
count 0 ; setq count(er) to 0
);setq
(repeat setLen ;repeat setlen times
(setq e1 (ssname lset count) ;setq ename to be the "0..." entity in selection set lset
e2 (entget e1)
p1 (dxf 10 e2)
p2 (dxf 11 e2)
);setq
(command "-insert" bname p1 "" ""
"-insert" bname p2 "" "")
(setq count (+ 1 count)) ; add 1 to Count(er)
);repeat
(princ "\nAll blocks have been copied")
(princ)
);defun
Here is the Ski_node lisp
(defun c:ski_node (/ ss)
;(c:ski_node)
(if (setq ss (ssget '((0 . "*line") (8 . "*AQ010"))))
(princ
(strcat
"\n"
(itoa
(length
(mapcar
(function
(lambda (x)
(if (null (ssget "_X" (list '(0 . "POINT,CIRCLE") (cons 10 x))))
(entmakex
(list
'(0 . "CIRCLE")
(cons 10 x)
'(40 . 0.006)
) ;_ list
) ;_ entmakex
) ;_ if
) ;_ lambda
) ;_ function
(apply (function append)
(mapcar
(function
(lambda (x)
(list
(vlax-curve-getStartPoint x)
(vlax-curve-getEndPoint x)
) ;_ list
) ;_ lambda
) ;_ function
(vl-remove-if
(function listp)
(mapcar (function cadr) (ssnamex ss))
) ;_ vl-remove-if
) ;_ mapcar
) ;_ apply
) ;_ mapcar
) ;_ length
) ;_ itoa
" ....errors found"
) ;_ strcat
) ;_ princ
) ;_ if
(princ)
)