求cad的一个lisp程序,要求鼠标在点击一点后,输入长、宽两个数值,就能出来矩形,并且自动画出矩形的对角线
答案:1 悬赏:30 手机版
解决时间 2021-02-25 08:34
- 提问者网友:杀手的诗
- 2021-02-24 17:07
要求鼠标在任意位置点击一点后,提示输入长、宽两个数值,就能出来矩形,并且自动画出矩形的对角线,对角线为虚线
最佳答案
- 五星知识达人网友:平生事
- 2021-02-24 18:21
(defun c:hk ()
(setq xy1 (getpoint "请点击矩形左下角:")
kd (getreal "请输入宽度:")
cd (getreal "请输入长度:")
xy2 (polar xy1 0 cd)
xy3 (polar xy2 (angtof "90") kd)
xy4 (polar xy1 (angtof "90") kd)
)
(command "pline" xy1 xy2 xy3 xy4 "c")
(command "line" xy1 xy3 "")
(setq a (entlast))
(command "change" a "" "p" "lt" "x0" "")
(command "line" xy2 xy4 "")
(setq a (entlast))
(command "change" a "" "p" "lt" "x0" "")
)
试一试,是不是这个效果,,
(setq xy1 (getpoint "请点击矩形左下角:")
kd (getreal "请输入宽度:")
cd (getreal "请输入长度:")
xy2 (polar xy1 0 cd)
xy3 (polar xy2 (angtof "90") kd)
xy4 (polar xy1 (angtof "90") kd)
)
(command "pline" xy1 xy2 xy3 xy4 "c")
(command "line" xy1 xy3 "")
(setq a (entlast))
(command "change" a "" "p" "lt" "x0" "")
(command "line" xy2 xy4 "")
(setq a (entlast))
(command "change" a "" "p" "lt" "x0" "")
)
试一试,是不是这个效果,,
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯