jim78b Posted July 26, 2019 Posted July 26, 2019 hello i try search in the web to understand how i can repeat multiple times this routine but nothing... (defun C:RT (/ gru) (setq gru (ssget)) (if gru (progn (command "_ROTATE" gru "") (princ "\nBase point e primo punto d'angolo: ") (command pause "_R") (command (getvar "LASTPOINT")) (princ "\nSecondo punto d'angolo: ") (command pause) (princ "\nAngolo finale: ") (command pause) ) ) (princ) ) i know there is a function called repeat n but i don't know where put it in my lisp.. Quote
dlanorh Posted July 26, 2019 Posted July 26, 2019 Try this (defun C:RT2 (/ osm gru b_pt b_ang ) (cond ( (/= (getvar 'osmode) 9) (setq osm (getvar 'osmode)) (setvar 'osmode 9))) (while (setq gru (ssget)) (cond (gru (setq b_pt (getpoint "\nBase point e primo punto d'angolo: ")) (command "_Rotate" gru "" b_pt "_R" b_pt) (prompt "\nSecondo punto d'angolo: ") (command pause) (prompt "\nAngolo finale: ") (command pause) ) ) (setq gru nil) ) (if osm (setvar 'osmode osm)) (princ) ) To exit the loop press enter or right click the mouse when asked to select objects. Quote
jim78b Posted July 26, 2019 Author Posted July 26, 2019 (edited) hello i try your code but is not that i want, sorry. after the last left mouse click i want that i click with left mouse and repeat the object multiple x times...when i rotate it... when i finish to copy i press right button. i have this that copy only one times... Quote (defun C:RTC (/ gru) (setq gru (ssget)) (if gru (progn (command "_COPY" gru "" (list 0 0)(list 0 0)) (command "_ROTATE" "_P" "") (princ "\nBase point e primo punto d'angolo: ") (command pause "_R") (command (getvar "LASTPOINT")) (princ "\nSecondo punto d'angolo: ") (command pause) (princ "\nAngolo finale: ") (command pause) ) ) (princ) ) Edited July 26, 2019 by jim78b Quote
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.