lisp语言 画形状田字问题 CAD二次开发 求大神指点一二
大神帮忙看一下哪里错了(defunc:pbox(/papbpcpdhhwwmp1mp2mp3mp4)(setqpa(getpoint"Enterleft/lowerpoi...
大神 帮忙看一下哪里错了(defun c:pbox(/ pa pb pc pd hh ww mp1 mp2 mp3 mp4)(setq pa(getpoint "Enter left/lower point "))(setq ww(getdist pa "\nwidth:"))(setq hh(getdist pa "\nheight:"))(setq pb(polar pa 0 ww))(setq pc(polar pb (/ pi 2) hh))(setq pd(polar pa (/ pi 2) hh))(command "pline" pa pb pc pd "c") (print)(setq mp1(polar pa 0 (/ ww 2)))(setq mp2(polar pb (/ pi 2) (/ hh 2)))(setq mp3(polar pc pi (/ ww 2)))(setq mp4(polar pa (/ pi 2) (/ hh 2)))(command "pline" mp1 mp2 mp3 mp4 ""))
怎么画出是这样子的 展开
怎么画出是这样子的 展开
1个回答
推荐于2016-07-23 · 知道合伙人软件行家
关注
展开全部
(defun c:pbox( / #os1 hh mp1 mp2 mp3 mp4 pa pb pc pd ww)
(setq #os1 (getvar "osmode"));取得捕捉设置
(setq pa (getpoint "Enter left/lower point "))
(setq ww (getdist pa "\nwidth:"))
(setq hh (getdist pa "\nheight:"))
(setq pb (polar pa 0 ww))
(setq pc (polar pb (/ pi 2) hh))
(setq pd(polar pa (/ pi 2) hh))
(setvar "osmode" 0);绘制动作的时候,关闭捕捉设置,否则会造成绘图不正确
(command "pline" pa pb pc pd "c")
(setq mp1 (polar pa 0 (/ ww 2)))
(setq mp2 (polar pb (/ pi 2) (/ hh 2)))
(setq mp3 (polar pc pi (/ ww 2)))
(setq mp4 (polar pa (/ pi 2) (/ hh 2)))
(command "pline" mp1 mp3 "");不相连的多段线要分别绘制
(command "PLINE" mp2 mp4 "")
(getvar "osmode" #os1);绘制完成后捕捉设置还原
)
追问
你太厉害了 能做我师傅吗 求QQ
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询