- (defun c:tt ()
- (initget "L l R r")
- (setvar "osmode" 0)
- (setq fx (getkword "请输入楼梯转动方向L or R: ")
- pa (getpoint "请输入左直角点: ")
- ww (getdist pa "\n请输入楼梯宽度: ")
- hh (getdist pa "\n请输入楼梯长度: ")
- n (getint "\n请输入楼梯阶数: ")
- dw (/ ww n 1.)
- dh (/ hh n 1.)
- pp pa
- fx (strcat fx)
- rad (if (= fx "R") 0 pi)
- )
- (command "pline" pp)
- (repeat n
- (setq p1 (polar pp (/ pi 2) dh)
- p2 (polar p1 rad dw)
- pp p2
- )
- (command p1 p2)
- )
- (command "")
- (setq pb (polar pa rad ww)
- pc (polar pb (/ pi 2) hh)
- )
- (command "line" pa pb pc "")
- (princ)
- )
|