Or maybe :
;;;|=====================================================================|;;;
;;;| Gap Line Tool |;;;
;;;|provided by James Hodson, SDC Edmonton, Company, 2009 |;;;
;;;|=====================================================================|;;;
;;;
;;;
(alert "Type GL to start, click a horizontal line to gap off of a vertical,
and click a vertical line to gap off of a horizontal
This runs again immediately if you hit space bar after your first two lines.
Happy Clicking!")
(defun c:gl (/ *error* sv_vals ar LINE1 LN P1 P2 AN LINE2 P3 P4 IN BPT1 PBT2)
(defun *error* (msg)
(mapcar '(lambda (x y) (setvar x y)) (list 'cmdecho 'osmode 'clayer) sv_vals)
(if (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\nAn Error : " msg " occurred.")))
);end_*error*
(setq sv_vals (mapcar 'getvar (list 'cmdecho 'osmode 'clayer)))
(mapcar '(lambda (x y) (setvar x y)) (list 'cmdecho 'osmode) '(0 0))
(cond ( (not *mygap*)
(setq *mygap* 0.0)
(initget 6)
(setq *mygap* (cond ( (getreal (strcat "\nEnter Gap Size <" (rtos *mygap* 2 3) "> : "))) (*mygap*)))
)
);end_cond
(while (not (setq ENT1 (car (entsel "\nSelect crossing line to break : "))))
(princ "\nNull Selection please try again: ")
)
(setq LINE1 (entget ENT1))
(setq LN (cdr (assoc 8 LINE1)))
(setq P1 (trans (cdr (assoc 10 LINE1)) 0 1 ))
(setq P2 (trans (cdr (assoc 11 LINE1)) 0 1 ))
(setq AN (angle P1 P2))
(while (not (setq ENT2 (car (entsel "\nSelect line to cross over : "))))
(princ "\nNull Selection please try again: ")
)
(setq LINE2 (entget ENT2))
(setq P3 (trans (cdr (assoc 10 LINE2))0 1))
(setq P4 (trans (cdr (assoc 11 LINE2))0 1))
(setq IN (inters P1 P2 P3 P4))
(setq BPT1 (polar IN AN (/ *mygap* 2)))
(setq BPT2 (polar IN (+ AN pi) (/ *mygap* 2)))
(command "break" ENT1 BPT1 BPT2)
(mapcar '(lambda (x y) (setvar x y)) (list 'cmdecho 'osmode 'clayer) sv_vals)
(setq *error* nil)
(princ)
)