Jump to content

Rotate copy reference around a centerpoint


alexcolodner

Recommended Posts

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...