Hi Alls,
My code is OK, but a few trouble if that code for use with rather far from a circle, or look at attach file "Figure Circle-1" , the line for centering can not over the circle, if you zoom a circle and then use that code it result is ok, the line for centering is over to the circle, or look at attach file "Figure Circle-2".
; tcc is stand for Toolbars Centering Circle
; Design by : Adesu <Ade Suharna>
; Email : mteybid@yuasabattery.co.id
; Homepage : http://www.yuasa-battery.co.id
; Create : 28 July 2006
; Program no.: 0389/07/2006
; Edit by : Adesu 27/09/2006 1).
(defun c:tcc (/ dis el1 el2 p1 p2 p3 p4 rad sp ss sse)
(if ; 1).
(setq ss (car (entsel "\nSelect a circle")))
(progn ; 1).
(setq sse (entget ss))
(setq sp (cdr (assoc 10 sse)))
(setq rad (cdr (assoc 40 sse)))
(setq dis (* rad 0.25))
(setq p1 (polar sp (* pi 1.5)(+ rad dis)))
(setq p2 (polar p1 (* pi 0.5)(+ (* rad 2.0)(* dis 2.0))))
(if
(and p1 p2)
(progn
(command "_line" p1 p2 "")
(setq el1 (entlast))
) ; progn
) ; if 1).
(setq p3 (polar sp pi(+ rad dis)))
(setq p4 (polar p3 0 (+ (* rad 2.0)(* dis 2.0))))
(command "_line" p3 p4 "")
(setq el2 (entlast))
(command "_chprop" el1 el2 "" "_lt" "center" "s" 1 "")
) ; progn
(alert "\nInvalid selected object,please try agagin") ; 1).
) ; if
(princ)
)