autolisp高手们,麻烦你们编个程序:实现画个多边形,然后以这多边形为边界,裁断和删除多边形外的图形。 50
这功能就像cass7.1中多指定边形存盘这命令功能,只是它弹出存盘对话框要手动输入文件名,实现不了批量化。所以要求助,先感谢了哈……要源代码哈,实现了另有分送哈老大们,一...
这功能就像cass 7.1中多指定边形存盘这命令功能,只是它弹出存盘对话框要手动输入文件名,实现不了批量化。所以要求助,先感谢了哈……
要源代码哈,实现了另有分送哈
老大们,一定要注意题目哈,不然我宁失50分也不会选没达到目标的任何答案哈。能现实的话再给150(既总共200分哈) 展开
要源代码哈,实现了另有分送哈
老大们,一定要注意题目哈,不然我宁失50分也不会选没达到目标的任何答案哈。能现实的话再给150(既总共200分哈) 展开
2个回答
展开全部
(defun c:yx(/ p0 p1 p2 p3 p4 r jiao cmd os )
(setq r (getdist"\n输入半径:"))
(if (= jiaodu nil)
(setq jiaodu 0))
(princ "\n输入角度:")(princ jiaodu)(princ "\n")
(setq shuru (getreal ""))
(if (/= shuru nil)
(setq jiaodu shuru))
(setq jiao (* pi (/ jiaodu 180)))
(setq p0 (getpoint "\n指定圆心"))
(while (/= p0 nil)
(setq cmd (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq os (getvar "osmode"))
(setvar "osmode" 0)
(command "circle" p0 r)
(setq p1 (polar p0 jiao (+ r 2)))
(setq p2 (polar p0 (+ jiao pi) (+ r 2)))
(setq p3 (polar p0 (+ jiao (/ pi 2)) (+ r 2)))
(setq p4 (polar p0 (- jiao (/ pi 2)) (+ r 2)))
(command "layer" "m" 5 "l" "center" 5 "c" 1 5 "")
(command "color" "bylayer")
(command "line" p1 p2 "")
(command "line" p3 p4 "")
(command "layer" "s" 0 "")
(command "color" "bylayer")
(setvar "osmode" os)
(setvar "cmdecho" cmd)
(setq p0 (getpoint "\n指定圆心"))
)
(princ)
)
(setq r (getdist"\n输入半径:"))
(if (= jiaodu nil)
(setq jiaodu 0))
(princ "\n输入角度:")(princ jiaodu)(princ "\n")
(setq shuru (getreal ""))
(if (/= shuru nil)
(setq jiaodu shuru))
(setq jiao (* pi (/ jiaodu 180)))
(setq p0 (getpoint "\n指定圆心"))
(while (/= p0 nil)
(setq cmd (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq os (getvar "osmode"))
(setvar "osmode" 0)
(command "circle" p0 r)
(setq p1 (polar p0 jiao (+ r 2)))
(setq p2 (polar p0 (+ jiao pi) (+ r 2)))
(setq p3 (polar p0 (+ jiao (/ pi 2)) (+ r 2)))
(setq p4 (polar p0 (- jiao (/ pi 2)) (+ r 2)))
(command "layer" "m" 5 "l" "center" 5 "c" 1 5 "")
(command "color" "bylayer")
(command "line" p1 p2 "")
(command "line" p3 p4 "")
(command "layer" "s" 0 "")
(command "color" "bylayer")
(setvar "osmode" os)
(setvar "cmdecho" cmd)
(setq p0 (getpoint "\n指定圆心"))
)
(princ)
)
追问
呵呵,你这程序跟不是我要的哈。你这个只是实现在画出特定圆并加中心线哈。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询