Hello,
I would greatly appreciate a push in the right direction...
I am creating a selection set using ssget...
Then I copy that selection set multiple times in a loop. What I would like to do is then rotate (or otherwise modify) the last copied group of items. If I rotate "last" it will only accept the last drawn item, so only one item in the group of copied objects will rotate.
Here is the portion of simple code I am using right now (it's in a loop so all variables with 'Next' are changing each time):
(command "_.copy" SS1 "" SS1Base NextPT)
(command "_.Rotate" "l" "" NextPT NextAng)
This works fine with a single object, but I can't figure out how to call up the entire group of objects.
Thank you.
Solved! Go to Solution.
Solved by alanjt_. Go to Solution.
@rick.hberg wrote:....
I am creating a selection set using ssget...
Then I copy that selection set multiple times in a loop. What I would like to do is then rotate (or otherwise modify) the last copied group of items. ....
Here's how I've done that kind of thing:
(command
"_.copy" SS1 "" "0,0" "@"
"_.move" "_previous" "" SS1Base NextPT
"_.Rotate" "_previous" "" NextPT NextAng
)
That Copies the set in place, then Moves and Rotates the Previous selection. So the collective "last" set of things is actually left in the original location. That way, you're always working with the Previous selection, which can be multiple objects.
This will also copy the objects in place. after that you can do pretty much anything after that
(defun c:CoRoT (/ ss) (if (ssget ":L") (progn (vlax-for itm (setq ss (vla-get-ActiveSelectionSet (vla-get-ActiveDocument (vlax-get-acad-object)) ) ) (vla-copy itm) ) (vla-delete ss) ) ) (sssetfirst nil (ssget "P"));<--- this is the previous selection set )
HTH
@alanjt_ wrote:What about the MOCORO command?
That's good, too. I've had a Copy-and-Rotate macro based on the Copy-in-place-then-Move-Previous-and-Rotate-that approach, as well as a Move-and-Rotate macro, since long before MOCORO existed, so I never took much notice when it came along. But it does seem to do what the OP is looking for a little more directly, in that if you go into the Copy option, it lets you make multiple Copies, and then when you go into the Rotate option, it Rotates just the latest of those. [And it has other capabilities like Scaling.]
I've never actually used it, but it seemed close enough to be worth mentioning.
Thanks to everyone for the replies.....all good info.
I never even knew about MOCORO, but it works perfect for the method I'm using.
Thanks again.