Not tested...
(defun c:cross+cut-lins ( / process ss gap i e lay laylst slay sss ch sscross sscut )
(defun process ( sscross sscut gap / p1e p2e p1c p2c ip p1 p2 )
(foreach e (vl-remove-if (function listp) (mapcar (function cadr) (ssnamex sscross)))
(foreach c (vl-remove-if (function listp) (mapcar (function cadr) (ssnamex sscut)))
(setq p1e (cdr (assoc 10 (entget e))) p2e (cdr (assoc 11 (entget e))))
(setq p1c (cdr (assoc 10 (entget c))) p2c (cdr (assoc 11 (entget c))))
(if
(and
(setq ip (inters p1e p2e p1c p2c))
(not
(or
(equal p1e ip 1e-3)
(equal p2e ip 1e-3)
)
)
)
(progn
(setq p1 (polar ip (angle ip p1e) (/ gap 2.0)))
(setq p2 (polar ip (angle ip p2e) (/ gap 2.0)))
(if command-s
(command-s "_.BREAK" e "_non" p1 "_non" p2)
(vl-cmdf "_.BREAK" e "_non" p1 "_non" p2)
)
)
)
)
)
)
(if
(and
(setq ss (ssget "_:L" (list (cons 0 "LINE"))))
(not (initget 5))
(setq gap (getdist "\nPick or specify gap : "))
)
(progn
(repeat (setq i (sslength ss))
(setq e (ssname ss (setq i (1- i))))
(setq lay (cdr (assoc 8 (entget e))))
(if (not (vl-position lay laylst))
(setq laylst (cons lay laylst))
)
)
(foreach lay laylst
(sssetfirst nil ss)
(setq slay (ssget "_I" (list (cons 8 lay))))
(setq sss (cons slay sss))
)
(if (= 2 (length sss))
(progn
(sssetfirst nil (car sss))
(initget "Yes No")
(setq ch (cond ( (getkword "\nAre highlighted lines crossings or cutting lines [Yes / No] <Yes> : ") ) ( "Yes" )))
(sssetfirst)
(if (= ch "Yes")
(progn
(setq sscross (car sss))
(setq sscut (cadr sss))
(process sscross sscut gap)
)
(progn
(setq sscut (car sss))
(setq sscross (cadr sss))
(process sscross sscut gap)
)
)
)
)
)
)
(princ)
)
HTH.
M.R.