Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

modify objects copied from a selection set

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
rick.hberg
655 Views, 6 Replies

modify objects copied from a selection set

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.

Civil 3D 2014
Windows 7 x64
6 REPLIES 6
Message 2 of 7
Kent1Cooper
in reply to: rick.hberg


@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.

Kent Cooper, AIA
Message 3 of 7
alanjt_
in reply to: Kent1Cooper

What about the MOCORO command?

Message 4 of 7
pbejse
in reply to: rick.hberg

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

Message 5 of 7
Kent1Cooper
in reply to: alanjt_


@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.]

Kent Cooper, AIA
Message 6 of 7
alanjt_
in reply to: Kent1Cooper

I've never actually used it, but it seemed close enough to be worth mentioning.

Message 7 of 7
rick.hberg
in reply to: alanjt_

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.

Civil 3D 2014
Windows 7 x64

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost