Copy this, save it to a file called CL.LSP, in AutoCAD type (Load"CL") and it will run, asking you to pick a circle, then the length of the extension past the circle.
(defun clerr (s)
(if (/= s "Function cancelled") ; If an error (such as CTRL-C) occurs
(princ (strcat "\nError: " s)) ; while this command is active...
)
(if e (redraw e 4))
(command "_.UCS" "_P") ; Restore previous UCS
(setvar "BLIPMODE" sblip) ; Restore saved modes
(setvar "GRIDMODE" sgrid)
(setvar "HIGHLIGHT" shl)
(setvar "UCSFOLLOW" sucsf)
(command "_.UNDO" "_E")
(setvar "CMDECHO" scmde)
(setq *error* olderr) ; Restore old *error* handler
(princ)
)
;;; --------------------------- Main Program ---------------------------------;
(setq olderr *error*
*error* clerr)
(setq scmde (getvar "CMDECHO"))
(command "_.UNDO" "_GROUP")
(setq clay (getvar "CLAYER"))
(setq sblip (getvar "BLIPMODE"))
(setq sgrid (getvar "GRIDMODE"))
(setq shl (getvar "HIGHLIGHT"))
(setq sucsf (getvar "UCSFOLLOW"))
(setvar "CMDECHO" 0)
(setvar "GRIDMODE" 0)
(setvar "UCSFOLLOW" 0)
(setq e nil)
(progn
(while (null e)
(setq e (entsel "\nSelect arc or circle: "))
(if e
(progn
(setq e (car e))
(if (and (/= (cdr (assoc 0 (entget e))) "ARC")
(/= (cdr (assoc 0 (entget e))) "CIRCLE")
)
(progn
(prompt "\nEntity is a ")
(princ (cdr (assoc 0 (entget e))))
(setq e nil)
)
)
(if e (redraw e 3))
)
)
(command "_.UCS" "_E" e)
(setq cen (trans (cdr (assoc 10 (entget e))) e 1))
(setq rad (cdr (assoc 40 (entget e))))
(prompt "\nRadius is ")
(princ (rtos rad))
(initget 7 "Length")
(setq d (getdist "\nLength/<Extension>: "))
(if (= d "Length")
(progn
(initget 7)
(setq d (getdist cen "\nLength: "))
)
(setq d (+ rad d))
)
(setvar "BLIPMODE" 0)
(setvar "HIGHLIGHT" 0)
; (command "_.LAYER" "_M" "CL" "")
(command "_.LINE" (list (car cen) (- (cadr cen) d) (caddr cen))
(list (car cen) (+ (cadr cen) d) (caddr cen)) ""
)
(command "_.CHANGE" "_L" "" "_P" "_LT" "CENTER" "")
(command "_.LINE" (list (- (car cen) d) (cadr cen) (caddr cen))
(list (+ (car cen) d) (cadr cen) (caddr cen)) ""
)
(command "_.CHANGE" "_L" "" "_P" "_LT" "CENTER" "")
)
)
(redraw e 4)
(command "_.UCS" "_P") ; Restore previous UCS
(setvar "BLIPMODE" sblip) ; Restore saved modes
(setvar "GRIDMODE" sgrid)
(setvar "HIGHLIGHT" shl)
(setvar "UCSFOLLOW" sucsf)
(command "_.UNDO" "_E")
(setvar "CMDECHO" scmde)
(setq *error* olderr) ; Restore old *error* handler
(princ)