Hippe013 Posted June 24, 2010 Share Posted June 24, 2010 Hey djw... you bet! Happy that I could help! Quote Link to comment Share on other sites More sharing options...
marknorm Posted June 28, 2010 Share Posted June 28, 2010 hi try this:) (defun c:ani (/ cntr entgrp fname num rotpnt) ; Turn command echoing off (setq cmdold (getvar "cmdecho")) ;(setvar "cmdecho" 0) ; Select the objects (setq entgrp (ssget)) ; Check to make sure you selected something (if entgrp (progn ; Set undo point (command ".undo" "Mark") ; Pick rotation point (setq rotpnt (getpoint "\nPick rotation point:<0,0,0> ")) (if (= rotpnt nil) (setq rotpnt (list 0 0 0)) ) ; Enter number of images (setq num (getint "\nEnter number of images:<5> ")) (if (= num nil) (setq num 5) ) ; Pick or enter degrees of movement (setq deg (getint "\nEnter degrees of movement:<3> ")) (if (= deg nil) (setq deg 3) ) ;Enter number name of the first image (setq cntr (getint "\nEnter the number name of the first image:<1> ") ) (if (= cntr nil) (setq cntr 1) ) ; Add your path here (setq dir (getstring T "/nEnter the directory name:<Ani>")) (if (= dir nil) (setq dir "Ani") ) (setq fnamechk (strcat "c:\\TestImage\\" dir)) (if (not (vl-file-directory-p fnamechk)) (vl-mkdir fnamechk) ) (repeat num (setq fname (strcat "c:\\TestImage\\" dir "\\" (itoa cntr) ".jpg") ) (progn ; Change the options (command "-render" "medium" "Render" "640" "480" "Yes" fname) ; Rotate the object (command ".move" entgrp "" "@0,0,0" "@0,0,-.25") (command ".rotate" entgrp "" rotpnt deg) (setq cntr (1+ cntr)) ) ; progn ) ; repeat (command ".undo" "Back") ) ; progn ) ; if ; Return echo (setvar "cmdecho" cmdold) (princ) ) Quote Link to comment Share on other sites More sharing options...
djw Posted June 28, 2010 Author Share Posted June 28, 2010 Rotate two objects (Clockwise) say 90 degrees at the same time, using a lisp on this post from Freerefill, got it to work for the 90 degrees. Butt (1) can't git it to go (Clockwise) (2) or Rotate two objects at the same time... Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 28, 2010 Share Posted June 28, 2010 One more example (you'll need the AT:SS->List subroutine located in my other post): (defun c:Test3 (/ ss gr) ;; Alan J. Thompson, 06.28.10 (if (setq ss (AT:SS->List (ssget "_:L" '((0 . "INSERT"))) T)) (while (and (eq 5 (car (setq gr (grread T 15 2)))) (vl-consp (cadr gr))) ((lambda (ang) (foreach x ss (vla-put-rotation x (+ (vla-get-rotation x) (setq ang (- ang))))) ) 0.02 ) ) ) (princ) ) Test2 (in my other post) is also an example of rotating multiple objects. These are all very simple, but should give you some ideas. Quote Link to comment Share on other sites More sharing options...
djw Posted June 28, 2010 Author Share Posted June 28, 2010 Hi Alanjt thanks but all I get Test3; error: no function definition: AT:SS->LIST it's Probably just me.. Please See Att Jpg.. Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 28, 2010 Share Posted June 28, 2010 Hi Alanjt thanks but all I getTest3; error: no function definition: AT:SS->LIST it's Probably just me.. Please See Att Jpg.. One more example (you'll need the AT:SS->List subroutine located in my other post): Read the entire post. Quote Link to comment Share on other sites More sharing options...
djw Posted June 28, 2010 Author Share Posted June 28, 2010 jpg did'nt upload please see PDF R1.pdf Quote Link to comment Share on other sites More sharing options...
MarcoW Posted June 28, 2010 Share Posted June 28, 2010 One more example (you'll need the AT:SS->List subroutine located in my other post): (defun c:Test3 (/ ss gr) ;; Alan J. Thompson, 06.28.10 (if (setq ss (AT:SS->List (ssget "_:L" '((0 . "INSERT"))) T)) (while (and (eq 5 (car (setq gr (grread T 15 2)))) (vl-consp (cadr gr))) ((lambda (ang) (foreach x ss (vla-put-rotation x (+ (vla-get-rotation x) (setq ang (- ang))))) ) 0.02 ) ) ) (princ) ) Test2 (in my other post) is also an example of rotating multiple objects. These are all very simple, but should give you some ideas. [ATTACH]21280[/ATTACH] Nice code AlanJT, I had some fun playing with this. If the selected blocks would come back in original place it could be useful also. (To point to blocks and animate them to inform which one was meant... yeah...I am bored too...) Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 28, 2010 Share Posted June 28, 2010 Nice code AlanJT, I had some fun playing with this.If the selected blocks would come back in original place it could be useful also. (To point to blocks and animate them to inform which one was meant... yeah...I am bored too...) with reset... (defun c:Test4 (/ ss gr) ;; Alan J. Thompson, 06.28.10 (if (setq ss (AT:SS->List (ssget "_:L" '((0 . "INSERT"))) T)) (progn (setq ss (mapcar (function (lambda (b) (cons b (vla-get-rotation b)))) ss)) (while (and (eq 5 (car (setq gr (grread T 15 2)))) (vl-consp (cadr gr))) ((lambda (ang) (foreach x ss (vla-put-rotation (car x) (+ (vla-get-rotation (car x)) (setq ang (- ang)))) ) ) 0.02 ) ) (foreach b ss (vla-put-rotation (car b) (cdr b))) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
MarcoW Posted June 28, 2010 Share Posted June 28, 2010 Funny lisp! Maybe I can use it to prank some collegues sometimes. Redifine te erase command.... lol Thanks for the input! Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 28, 2010 Share Posted June 28, 2010 Funny lisp! Maybe I can use it to prank some collegues sometimes. Redifine te erase command.... lol Thanks for the input! HaHa, go for it. You're welcome. Quote Link to comment Share on other sites More sharing options...
Hippe013 Posted June 28, 2010 Share Posted June 28, 2010 jpg did'nt upload please see PDF djw Could you upload your dwg or dxf? It would be easier to create a lisp to animate those objects if we knew what it was that was needed to animate. hippe013 Quote Link to comment Share on other sites More sharing options...
djw Posted June 29, 2010 Author Share Posted June 29, 2010 U have a new Private Messages, let me know.. thanks again Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.