Using a UCS is a pretty ugly way of doing that. It only works on lines, and it may not work right if your lines are not perpendicular. Routines should generally not change the UCS, unless that is part of the purpose of the routine. In most cases, you shouldn't change to a temporary UCS for calcs in a Lisp routine; there's probably a better way of approaching the problem if you think about it a bit. (The primary exception is when you want to switch to the OCS of a given entity to simplify some complex calculation.)
How about this? Select the line you want to break, and then the centerpoint of your break (not the crossing line). Works on any applicable entity (line, arc, polyline, etc.). I have you pick the entity first as the simple way of dealing with overlapping entities.
; mb.lsp v1.00
; Richard Sincovec 9/23/04
; Creates a measured break around pick point
(defun c:mb (/ entity brkpt endd d1 d2 osmode)
(if (null mb:width)
(setq mb:width 0.0625) ; default value
) ;_ if
(setq mb:width
(cond
((getdist
(strcat
"\nDistance to trim from either side of pick point <"
(rtos mb:width)
">: "
) ;_ strcat
) ;_ getdist
)
(mb:width)
) ;_ cond
) ;_ setq
(while (setq entity (car (entsel "\nSelect entity: ")))
(if
(setq brkpt (getpoint "\nSelect point to break: "))
(progn
(setq brkpt (vlax-curve-getDistAtPoint
entity
(vlax-curve-getClosestPointTo entity brkpt)
) ;_ vlax-curve-getDistAtPoint
endd (vlax-curve-getDistAtPoint
entity
(vlax-curve-getEndPoint entity)
) ;_ vlax-curve-getDistAtPoint
d1 (- brkpt mb:width)
d2 (+ brkpt mb:width)
) ;_ setq
(if (< d1 0)
(setq d1 0)
) ;_ if
(if (< endd d2)
(setq d2 endd)
) ;_ if
(setq osmode (getvar "osmode")) ;_ setq
(setvar "osmode" 0)
(command "break"
(list entity (vlax-curve-getPointAtDist entity d1))
(vlax-curve-getPointAtDist entity d2)
) ;_ command
(setvar "osmode" osmode)
) ;_ progn
) ;_ if
) ;_ while
(princ)
) ;_ defun