I'm looking for a routine that will select a line, then that line will be broken at points where it intersect other lines.
Or better, to draw a line which will break when intersect with other lines.
Though I've found a few codes that can be modified, I'm not familiar with LISP. Any help will be much appreciated. Thanks!
(defun c:brkint (/ BRK-PT1 BRK-PT2 GAP GAP1A INT-LIN1
INT-LIN1A INT-LIN2A INT-PT1 INT-PT2
INT-PT3 INT-PT4 INT-PT5 NUMLIN OLD-AUNITS
OLD-LUNITS OLD-OSNAP OLD_ERROR ONSEG PICKTYPE PT1 PT2)
(SETVAR "CMDECHO" 0)
(setq old-osnap (getvar "osmode"))
(setq old-lunits (getvar "lunits"))
(setq old-aunits (getvar "aunits"))
(setvar "osmode" 0)
(setvar "lunits" 2)
(setvar "aunits" 0)
(setq old_error *error*)
(defun *error* (msg)
(if (not
(member
msg
'("console break" "Function cancelled" "quit / exit abort")
)
)
(progn
(setvar "osmode" old-osnap)
(setvar "lunits" old-lunits)
(setvar "aunits" old-aunits)
(redraw (car int-lin1) 4)
(SETVAR "CMDECHO" 1)
)
)
)
;;;(setq gap2 (if (= gap nil) 0.125 gap))
;;;(setq gap (getreal (strcat "\nEnter Break Gap Distance " "<" (rtos gap2)
">" ": ")))
;;;(if (= gap nil) (setq gap gap2))
(setq gap 1.5)
(setq gap1a (/ gap 2))
(setq int-lin1 (entsel "\nSelect the Line to use as the Cutting Line: "))
(redraw (car int-lin1) 3)
(setq int-lin1a (entget (car int-lin1)))
(setq int-pt1 (cdr (assoc 10 int-lin1a)))
(setq int-pt2 (cdr (assoc 11 int-lin1a)))
(initget 1 "F P")
(setq picktype (getkword "\nUse Fence or Pick Lines to Break? <F or P>: "))
(if (= picktype "F")
(progn
(setq pt1 (getpoint "\nLines to Break -> Pick First Fence Point: "))
(setq pt2 (getpoint pt1 "\nPick Second Fence Point: "))
(setq fence-cut (ssget "F" (list pt1 pt2) '((0 . "LINE")) ))
(setq numlin 0)
(while (<= numlin (- (sslength fence-cut) 1))
(setq int-lin2 (entget (ssname fence-cut numlin)))
(setq int-pt3 (cdr (assoc 10 int-lin2)))
(setq int-pt4 (cdr (assoc 11 int-lin2)))
(setq int-pt5 (inters int-pt1 int-pt2 int-pt3 int-pt4 onseg))
(setq brk-pt1 (polar int-pt5 (angle int-pt5 int-pt3) gap1a))
(setq brk-pt2 (polar int-pt5 (angle int-pt5 int-pt4) gap1a))
(command "break" (ssname fence-cut numlin) brk-pt1 brk-pt2)
(setq numlin (+ numlin 1))
);end while
);end progn
(progn
(while ;(= int-lin2 nil)
(setq int-lin2 (entsel "\nSelect Line to Break: "))
(setq int-lin2a (entget (car int-lin2)))
(setq int-pt3 (cdr (assoc 10 int-lin2a)))
(setq int-pt4 (cdr (assoc 11 int-lin2a)))
(setq int-pt5 (inters int-pt1 int-pt2 int-pt3 int-pt4 onseg))
(setq brk-pt1 (polar int-pt5 (angle int-pt5 int-pt3) gap1a))
(setq brk-pt2 (polar int-pt5 (angle int-pt5 int-pt4) gap1a))
(command "break" int-lin2 "f" brk-pt1 brk-pt2)
;(setq int-lin2 nil)
);end while
);end progn
);end if
(setvar "osmode" old-osnap)
(setvar "lunits" old-lunits)
(setvar "aunits" old-aunits)
(redraw (car int-lin1) 4)
(setq *error* old_error)
(SETVAR "CMDECHO" 1)
(princ)
)
[/code]
--
Jeff
check out www.cadvault.com
"chadidjaja" <nos...@address.withheld> wrote in message
news:27985252.109295280...@jiveforum1.autodesk.com...
The routine allows me to select a cutting line, then the lines to be broken; while I'm needing one that allows me to select which line to be broken, then the selected line will be cut by all intersecting lines on the same layer.