- (defun c:88(/ dh dw h n p1 p2 pa pb pc pts w)
- (setq pa(getpoint "\n选择基点:"))
- (setq w (getdist pa "\n输入楼梯踏面宽度:" ))
- (setq pb(polar pa 0 w))
- (setq h (getdist pa "\n输入楼梯高度:" ))
- (setq pc(polar pb (/ pi 2) h ))
- (setq n (getint "\n输入楼梯阶数:"))
- (setq dw (/ w n))
- (setq dh (/ h n))
- (setq pts '())
- (setq pts (append pts (list pc pb pa)))
- (setq p1 (polar pa (/ pi 2) dh ))
- (setq p2 (polar p1 0 dw ))
- (repeat n
- (setq pts (append pts (list p1 p2)))
- (setq p1 (polar p2 (/ pi 2) dh ))
- (setq p2 (polar p1 0 dw ))
- )
- (entmake (append (list
- '(0 . "LWPOLYLINE")
- '(100 . "AcDbEntity")
- '(100 . "AcDbPolyline")
- (cons 90 (length pts))
- (cons 70 1)
- )
- (mapcar '(lambda (a) (cons 10 a)) pts))
- )
- (princ)
- )
用entmake 就通用了 |