AutoCAD LISP利用直角顶点斜边和一条直角边绘制直角三角形,还可以显示变长和角度信息。
(defun c:test()
(setq pa (getpoint "直角定点:"))
(setq ww (getreal "\n底边长:"))
(setq kk (getreal "\n斜边长:"))
(setq pb (polar pa 0 ww))
(setq hh (sqrt (- (* kk kk) (* ww ww))))
(setq pc (polar pa (/ pi 2) hh))
(command "line" pa pb pc "c")
)
代码完。