(defun cl_fn ( cl_orig / shl sucsf e cen rad d ts xx)
(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)
)
)
)
)
)
(setq cen (trans (cdr (assoc 10 (entget e))) e 1))
(setq rad (cdr (assoc 40 (entget e))))
(prompt (strcat “nRadius is ” (rtos rad)))
(prompt (strcat “nDiameter is ” (rtos (* rad 2.0))))
(setq cen_dia (rad 2.0))
(setq cen_dia (+ rad cen_dia))
(if cl_orig
(progn
(prompt (strcat “nLength <” (rtos cen_dia) “> : “))
(setq d (getdist cen))
(if (null d)
(setq d cen_dia)
)
)
(setq d cen_dia)
)
(command “_layer” “s” “center” “”)
(command “color” “8” “”)
(command “-linetype” “s” “center” “”)
(command “LINE” (list (car cen) (- (cadr cen) d) (caddr cen))
(list (car cen) (+ (cadr cen) d) (caddr cen))
“”
)
; (chcenl (entlast))
(command “LINE” (list (- (car cen) d) (cadr cen) (caddr cen))
(list (+ (car cen) d) (cadr cen) (caddr cen))
“”
)
; (chcenl (entlast))
(command “_layer” “s” “0” “”)
(command “color” “Bylayer” “”)
(command “-linetype” “s” “Bylayer” “”)
)
(defun c:cl() (cl_fn T) (princ))
(defun c:cl2() (cl_fn nil) (princ))