;; brl.lsp ;-------------- BREAK LINES ONLY -------------; ;; by Fatty T.O.H. () 2006 * all rights removed ;; tested: 8/24/06 (A2005) ;; 2/21/08 (A2008) ;; edited 3/5/12 (A2009) (defun C:BRL (/ acspadoc i line_obj ln nl obj_list1 obj_list2 ss1 tmp) (setq adoc (vla-get-activedocument (vlax-get-acad-object) ) acsp (vla-get-block (vla-get-activelayout adoc) ) ) (vla-startundomark adoc) (alert "Select all lines to break") (if (not ss1) (setq ss1 (ssget '((0 . "LINE")))) ) (setq i -1) (repeat (sslength ss1) (setq i (1+ i)) (setq line_obj (vlax-ename->vla-object (ssname ss1 i) ) ) (setq obj_list1 (cons line_obj obj_list1)) ) (setq obj_list2 (reverse obj_list1)) (foreach ln obj_list1 (setq tmp (vl-remove-if (function not) (mapcar (function (lambda (x) (vlax-invoke ln 'Intersectwith x (cond ((or (not (eq (vlax-curve-getclosestpointto x (vlax-curve-getstartpoint ln) ) (vlax-curve-getstartpoint ln) ) ) (not (eq (vlax-curve-getclosestpointto x (vlax-curve-getendpoint ln) ) (vlax-curve-getendpoint ln) ) ) ) acExtendOtherEntity ) (T acextendnone) ) ) ) ) obj_list2 ) ) ) (setq tmp (append tmp (list (vlax-get ln 'StartPoint) (vlax-get ln 'EndPoint) ))) (setq tmp (vl-sort tmp (function (lambda (q p) (< (vlax-curve-getparamatpoint ln q) (vlax-curve-getparamatpoint ln p))))) ) (mapcar (function (lambda (x y) (setq nl (vla-addline acsp (vlax-3d-point x) (vlax-3d-point y))) (mapcar '(lambda (p) (vlax-put nl p (vlax-get ln p))) (list 'layer 'linetype 'linetypescale 'lineweight 'color)) ) ) tmp (cdr tmp) ) ) (mapcar 'vla-delete obj_list1) (mapcar 'vlax-release-object obj_list1) (vla-regen adoc acactiveviewport) (vla-endundomark adoc) (princ)) (prompt "\ntype BRL to execute ...") (princ) (or (vl-load-com) (princ))