 - [FONT=courier new](defun c:test (/ x y x1 y1 pt0 hh)
- (cmdla0)
- (if (null word)
- (setq word "R")
- )
- (if (= word "R")
- (setq k 1)
- (setq k -1)
- )
- (if (not hf)
- (setq hf 1500.0)
- )
- (if (not num)
- (setq num 10)
- )
- (if (not bs)
- (setq bs 250.0)
- )
- (if (not ts)
- (setq ts 100.0)
- )
- (setq word (UKWORD 1 "L R" "方向: L-左边/R-右边" word)
- hf (UREAL 7 "" "\n楼梯高" hf)
- num (UREAL 7 "" "\n楼梯踏步数" num)
- bs (UREAL 7 "" "\n楼梯踏步宽" bs)
- ts (UREAL 7 "" "\n楼梯踏步厚" ts)
- pt0 (UPOINT 1 "" "\n起点" pt0 nil)
- x (car pt0)
- y (cadr pt0)
- x1 x
- y1 y
- hh (/ hf num)
- )
- (setvar "osmode" 0)
- (command "pline" pt0)
- (repeat num
- (setq x1 (+ x1 (* k bs))
- y1 (+ y1 hh)
- pt1 (list x y1)
- pt2 (list x1 y1)
- )
- (command pt1)
- (command pt2)
- (setq x x1
- y y1
- )
- )
- (command "")
- (setq hh (/ (* (sqrt (+ (* bs bs) (* hh hh))) ts) bs)
- x (car pt0)
- y (- (cadr pt0) hh)
- y1 (- y1 hh)
- )
- (command "line" (list x y) (list x1 y1) "")
- (cmdla1)
- )[/FONT]
|