CAD AutoLisp 绘制网格
lisp
(defun C:TT()
(setq s 5)
(setq pt1 (getpoint "\nGet"))
(setq pt2 (getcorner pt1 "\nGet"))
(setq c (/ (- (car pt2)(car pt1)) s))
(setq h (/ (- (cadr pt2)(cadr pt1)) s))
(command "rectang" pt1 pt2 "EXPLODE" "l")
(setq i 1)
(repeat (1- s)
(setq p1 (polar pt1 0 (* c i)))
(setq pp1 (polar pt1 (* (/ pi 180)90) (* h i)))
(command "line" "non" p1 "non" (polar p1 (* (/ pi 180)90)(* h 5)) "")
(command "line" "non" pp1 "non" (polar pp1 0(* c 5)) "")
(setq i (1+ i))
)
)