需要判断是左转90°还是右转
需要判断是左转90°还是右转 (pi) (defun c:tt ()
(setq p1 (getpoint "画图起始位置"))
(setq w (getdist "\n距离:"))
(setq jd (getdist "\n角度:1水平右 2水平左 3直角右 4直角左"))
(if (=1 jd 1)(setq jd 0))
(if (=2 jd 2)(setq jd 180))
(if (=3 jd 3)(setq jd 90))
(if (=4 jd 4)(setq jd -90))
(setq ang (* (/ jd 180) 3.1415926))
(setq p2 (polar p1 ang w))
(command "line" p1 p2 "")
(setq x 0)
(while (and (setq px p2)
(setq w (getdist "\n距离:"))
(setq jd (getdist "\n角度:"))
(setq jd (getdist "\n角度:1水平右 2水平左 3直角右 4直角左"))
(if (=1 jd 1)(setq jd 0))
(if (=2 jd 2)(setq jd 180))
(if (=3 jd 3)(setq jd 90))
(setq ang (* (/ jd 180) 3.1415926))
(setq p2 (polar px ang w))
(command "line" px p2 "")
)
)
) 代码测试好像有点不行,没有找到问题 搞不懂你要干嘛,长度要自己输、角度要自己输,方向要自己输。。。。那不就是直接用pline命令不就行了 我咋没看懂呀
页:
1
[2]