Romero Posted August 8, 2019 Posted August 8, 2019 Hello everyone. I am working with a code to copy object (s) and paste with rotation using the same base point as the axis of rotation. What I can't do is create a while cycle to be able to make multiple copies and rotate. I could only do it once. If someone helps me a little I would be very grateful. (defun c:cr (/ ss p1 p2 p3) (setq ss (ssget)) (command "copy" ss "" "0" "0") (setq p1 (getpoint "\n base Point: ")) (setq p2 (getpoint "\n destination point: ")) (command "move" ss "" p1 p2) (setq p3 (getpoint "\n reference point: ")) (command "rotate" ss "" p2 "R" "@" p3 pause) ) Quote
Lee Mac Posted August 8, 2019 Posted August 8, 2019 Perhaps something like this? (defun c:cr ( / p q r s ) (if (and (setq s (ssget "_:L")) (setq p (getpoint "\nSpecify base point: ")) (setq q (getpoint "\nSpecify destination point: " p)) (vl-cmdf "_.move" s "" "_non" p "_non" q) (setq r (getpoint "\nSpecify reference point: " q)) ) (while (vl-cmdf "_.rotate" s "" "_non" q "_C" "_R" "@" "_non" r "\\")) ) (princ) ) Quote
Romero Posted August 8, 2019 Author Posted August 8, 2019 (edited) 6 hours ago, Lee Mac said: Perhaps something like this? Hi @Lee Mac, thank you very much for your response. I really appreciate the help, but unfortunately it's not what I wanted. Maybe I didn't know how to explain myself well, and it's all my fault. I will try to explain it better to see if it is possible to help me: The problem is that I want to copy the same object, but I have to put several points: (destination point) 1.-I want to designate objects and be able to create multiple copies 2.-But when you copy the object, it can be rotated with a reference, which begins at the base point (So far I have no problem) 3.- without abandoning the command, copy the same object again, to create another copy and rotate it in the same way; For that, I would have to create a new point (destination point), but I can't solve it. 4.-repeat until canceled. Edited August 8, 2019 by Romero Quote
myloveflyer Posted August 9, 2019 Posted August 9, 2019 (edited) It is best to provide a drawing before processing and processing, so that everyone can help you. Edited August 9, 2019 by SLW210 Removed Quote 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.