;;; motion1.lsp ;;; a program that moves a ball down 10 stairs ;;; copyright 1997 by charles w. robbins (alert "motion1.lsp - copyright 1997 by charles w. robbins. type m1 to start") ;;; start the program (defun c:m1 (/) ;;; select the ball (setq ss1 (ssget "x" '((8 . "ball")))) ; select the ball (setq filename 1000) ; start saving files at 1000 ;;; stair while loop (setq staircounter 0) ; set staircounter to 0 (while (< staircounter 10) ; 10 increment loop ;;; horizontal movement loop (setq counter1 0) ; set counter to 0 (while (< counter1 5) ; 5 increment loop (command "move" ss1 "" "@" "@2,0") ; move ball 2in. to right (c:saveimg (itoa filename) "bmp") ; save file as a bitmap (setq filename (1+ filename)) ; add one to the filename (setq counter1 (1+ counter1)) ; add one to the counter ) ;;; vertical movement loop (setq counter1 0) ; set counter to 0 (while (< counter1 4) ; 4 increment loop (command "move" ss1 "" "@" "@0,-2") ; move ball 2in. down (c:saveimg (itoa filename) "bmp") ; save file as a bitmap (setq filename (1+ filename)) ; add one to the filename (setq counter1 (1+ counter1)) ; add one to the counter ) (setq staircounter (1+ staircounter)) ; add one to the staircounter ) ;;; end of program )