lisp 画一个矩形

(defun c:tt ()
  (setq p1 (getpoint "第一点:"))
  (setq p2 (getpoint p1 "\n**第二点:"))
  (setq w (getdist "\n输入宽度:"))
  (setq h (getdist "\n输入长度:"))
  (setq	ang (angle p1 p2)
	l   (distance p1 p2)
  )
  (setq p2 (polar p1 ang w));0度
  (setq p3 (polar p2 (+ ang (* 0.5 pi)) h));90度
  (setq p4 (polar p3 (+ pi ang) w));180度
  (command "line" p1 p2 "")
  (command "line" p2 p3 "")
  (command "line" p3 p4 "")
  (command "line" p4 p1 "")
)

你可能感兴趣的:(AutoLisp,lisp,开发语言)