这将避免与捕捉点混淆。
- (defun c:Stp (/ Point Rise Tread Nos LandingAt P1 LandingLength n P2 P3 OsmodeOld)
- (setq Point (getpoint "\nPick a Point:")
- Rise (getdist "\nEnter rise of each step:")
- Tread (getdist "\nEnter tread of each step:")
- Nos (getint "\nEnter number of steps:")
- LandingAt (Getint "\nNumber of steps in first flight:")
- P1 (list (car Point) (cadr Point))
- LandingLength (getdist "\nEnter Length of Landing:")
- n 0
- OsmodeOld (getvar "OSMODE")
- ) ;_setq
- (setvar "OSMODE" 0)
- (While
- (< n Nos)
- (if
- (<= n LandingAt)
- (Progn ;If True
- (Setq
- P2 (polar Point (GetRad 90) Rise)
- P3 (Polar P2 0 Tread)
- ) ;_setq
- ) ;_progn
- (progn ;Else
- (Setq
- P2 (polar Point (GetRad 90) Rise)
- P3 (Polar P2 (GetRad 180) Tread)
- ) ;_setq
- ) ;_progn
- )
- (vl-cmdf "_.LINE" Point P2 P3 "")
- (Setq Point P3
- n (1+ n)
- ) ;_setq
- ) ;While Ends
- (setvar "OSMODE" OsmodeOld)
- (princ)
- ) ;STP Ends
- ;======================================::::::
- ;Function to Convert Degrees to Radians::::::
- ;======================================::::::
- (defun GetRad (Ang)
- (/ (* 3.14 Ang) 180)
- )
- ;|«Visual LISP© Format Options»
- (120 2 2 2 nil "Ende von " 100 9 0 0 0 T T nil T)
- ;*** DO NOT add text below the comment! ***|;
塔瓦特 |