CAD AutoLisp 根据圆绘制坐标轴
(setq RR (* r 1.2));
绘制线为半径的倍数command "chprop"
需要确定图层,示例中选择的是中心线图层
lisp
(defun C:TT()
(setq ss (ssget '((0 . "CIRCLE,ARC"))))
(setq i 0)
(repeat (sslength ss)
(setq ent (entget (ssname ss i)));获取组码
(setq pt (cdr (assoc 10 ent)));获取圆心坐标
(setq R (cdr (assoc 40 ent)));获取半径
(setq RR (* r 1.2));系数1.2倍
(setq x (car pt))
(setq y (cadr pt))
(setq p1 (list (- x rr) y))
(setq p2 (list (+ x rr) y))
(command "LINE" "NON" p1 "NON" p2 "")
(command "chprop" "L" "" "P" "LA" "中心线" "")
(setq p3 (list x (- y rr)))
(setq p4 (list x (+ y rr)))
(command "LINE" "NON" p3 "NON" p4 "")
(command "chprop" "L" "" "P" "LA" "中心线" "")
(setq i (1+ i))
)
(princ)
)