alexcolodner Posted November 4, 2017 Share Posted November 4, 2017 Hi all, I've been trying to create a macro to rotate an object around a centerpoint while copying it. If doing this the long way my actions are as follows: rotate enter select object enter center enter select basepoint copy enter reference enter center specify reference angle specify second point specify new angle can somebody give me some guidance? Is it not possible to use center osnap command in a macro? Should this be done with a LISP? Thanks! Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 4, 2017 Share Posted November 4, 2017 Doing it in a different order may be easier. Pick object 1st. (defun c:rocop ( / ss pt1 pt2 pt3) (setq ss (ssget)) (setq pt1 (getpoint "pick Centre pt")) (setq pt2 (getpoint pt1 "1st angle point")) (setq pt3 (getpoint pt1 "2nd angle point")) (command "rotate" ss "" pt1 "Copy" "R" pt1 pt2 pt3) ) Quote Link to comment Share on other sites More sharing options...
alexcolodner Posted November 6, 2017 Author Share Posted November 6, 2017 Thanks BIGAL. This is close to what I'm trying to achieve but is missing a couple steps I think that make it function the way I want it to. Below is a capture of what i need it to do: https://i.imgur.com/j62ryJx.gifv Hopefully this is more clear. Is this something achievable? Thanks! Quote Link to comment Share on other sites More sharing options...
nukecad Posted November 6, 2017 Share Posted November 6, 2017 Any reason this has to be a macro/lisp? Can you not just use the polar array command? Quote Link to comment Share on other sites More sharing options...
alexcolodner Posted November 6, 2017 Author Share Posted November 6, 2017 Any reason this has to be a macro/lisp? Can you not just use the polar array command? Polar array would work for the example I showed, however I really only meant it as an example to demonstrate the process. I use this often on larger scales with multiple increments, etc. This is the best way I've found over the years for the particular application but finally decided to try and speed it up by eliminating some key stroke, if possible. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 7, 2017 Share Posted November 7, 2017 Its totally different to what you asked for, pick circle, pick object, pick chord 2 points, how many required clockwise or anti. It also depends a bit on how say that square is drawn is it the corners that touch the circle ? This is a Gear type lisp solution using pitch for gear spacing. Its not that hard to do anyway had a few minutes. ; simple rotatecopy ; By Alan H nov 2017 (defun c:rocop ( / ss pt1 pt2 pt3) (setq pt1 (getpoint "pick Centre pt")) (setq pt2 (getpoint pt1 "1st angle point")) (setq pt3 (getpoint pt1 "2nd angle point")) (setq howmany (Getint "Enter How many")) (setq ss (ssget)) (command "rotate" ss "" pt1 "Copy" "R" pt1 pt2 pt3) (if (= howmany 1)(princ "1") (progn (repeat (- howmany 1) (command "rotate" (entlast) "" pt1 "Copy" "R" pt1 pt2 pt3) ) ) ) ) Quote Link to comment Share on other sites More sharing options...
alexcolodner Posted November 7, 2017 Author Share Posted November 7, 2017 BIGAL, thanks! That actually work better than what I was asking for since I can specify multiple copies as opposed to copying one, then copying 2, then copying 4, etc. I very much appreciate you taking the time to respond and write this little script up for me. 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.