- 积分
- 704
- 明经币
- 个
- 注册时间
- 2002-7-5
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
用以下中心线标注程式标注中心线时,当画一个很小的圆如1--3mm直径,并将图视口范围放大到看到圆只是一个很小的圈时,用此程式选取圆画中心线,无法成功,,,只能画出一条水平中心线或一个中心点.......
将视口变小,圆看得清晰一些大一些一切正常!
(defun c:center-5( / ss i j ent ents ptc r pts)
(command "undo" "be")
(command "ltscale" "0.2" "" "")
(if (=(tblobjname "LAYER" "center") nil)
(command "-layer" "m" "center" "c" 1 "" "L" "center" "" ""))
(command "-layer" "s" "center" "")
(setq ss (ssget '((0 . "CIRCLE"))))
(setq i 0)
(repeat (sslength ss)
(setq ent (ssname ss i))
(setq ents (entget ent))
(setq ptc (cdr (assoc 10 ents))
r (cdr (assoc 40 ents))
j 0
pts'())
(repeat 4
(setq pts (append pts (list (polar ptc (* j (/ pi 2)) (+ r (/ r 3))))))
(setq j (1+ j))
)
(command "_.line" (nth 0 pts) (nth 2 pts) ""
"_.line" (nth 1 pts) (nth 3 pts) "")
(setq i (1+ i))
)
(command "undo" "be")
(princ)
) |
|