Jump to content
alexcolodner

Rotate copy reference around a centerpoint

Recommended Posts

alexcolodner

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!

Share this post


Link to post
Share on other sites
BIGAL

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)
)

Share this post


Link to post
Share on other sites
alexcolodner

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!

Share this post


Link to post
Share on other sites
nukecad

Any reason this has to be a macro/lisp?

 

Can you not just use the polar array command?

Share this post


Link to post
Share on other sites
alexcolodner
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.

Share this post


Link to post
Share on other sites
BIGAL

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)
)
)
)
)

Share this post


Link to post
Share on other sites
alexcolodner

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. :winner:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×