求高手帮个忙 画圆代码
求个代码 画圆 选中心点选任意距离 向圆心偏移10mm 到中心! (defun c:c20 ( )(setq oldlay (getvar "clayer"))
(setvar "osmode" 0)
(setvar "cmdecho" 0)
(setq d (getreal "\n请输入直径或默认:")
d (/ (if d d 20)))
(setq pl (getpoint "\n指定中心点或按esc键退出:"))
(setq r (/ d 2))
(command "circle" pl r )
(setq npy (getint "\n偏移次数<4>:"))
(if (null npy) (setq npy 3))
(setq pyd (getvar "offsetdist" ))
(setq pyd (abs pyd))
(setq str_1 (strcat "\n偏移距离<" (rtos pyd) ">:"))
(setvar "offsetdist" pyd)
(setq pydi (getreal str_1))
(if (null pydi) (setq pydi 10))
(setq pyd1 (/ pydi 2))
(setq en (car (entsel "\n选择对象:")))
(setq pt1 (getpoint "\n指定点以确认偏移方向:"))
(setq i 1)
(repeat npy
(setq pydis (* i pyd1))
(command "offset" pydis en pt1 "")
(setq i (1+ i))
)
(setvar "offsetdist" pydi)
(setvar "osmode" 16383)
(setvar "clayer" oldlay)
(princ)
)
试下这个,你再改进下 linheyuanpcb 发表于 2012-4-30 11:54 static/image/common/back.gif
(defun c:c20 ( )
(setq oldlay (getvar "clayer"))
(setvar "osmode" 0)
基本达到了要求 高手无处不在呀 谢谢 给力 谢谢2楼楼主的分享!很有意思的软件,收藏备用。 这个写的有点复杂吧
谢谢2楼楼主
页:
[1]