如何用LISP语言画一个已知度数的角
比如说我要画一个13度的角,怎么样用lISP语言实现?请高手指教 (defun C:AnyAngle(/ degree vertex startEdge endEdge pb pc)(setvar "cmdecho" 0)
(setq degree (getreal "\n 输入角度值"))
(setq vertex (getpoint "\n 输入基准点A:"))
(setq startEdge (getreal "\n 起始边长度:"))
(setq endEdge (getreal "\n 终止边长度:"))
(setq pb (polar vertex 0 startEdge))
(setq pc (polar vertex (* (/ degree 180) pi) endEdge))
(command "line" vertex pb "")
(command "line" vertex pc "")
(prin1)
)
command:anyangle
输入角度值13
输入基准点A:
起始边长度:50
终止边长度:50
执行结果:
本帖最后由 pengq2010 于 2011-4-27 10:43 编辑
(defun C:JD()
(setq P1 (getpoint "请输入顶角所在点:"))
(command "line" P1 "@200<45" "")
(command "line" P1 "@200<0""")
(prin1)
)
提供另外一种思路,利用CAD自身命令画图。 回复 dcj_gis2006 的帖子
非常感谢! 回复 pengq2010 的帖子
感谢提供的新思路,谢谢!
页:
[1]