Swapping 2 object postions

Swapping 2 object postions

Anonymous
Not applicable
1,941 Views
6 Replies
Message 1 of 7

Swapping 2 object postions

Anonymous
Not applicable

I have come across a problem where I cant find a command or quick simple 2 step process to solve and the solution I think would make a lot of peoples lives easier, I want to "swap" 2 objects around into each others positions say for instance swap a 12 tooth gear swapped with a 6 tooth gear into the 12 tooth position and the 12 tooth into the 6 tooth position...…………….Autodesk guys can you think of a way to do this that is similar to moving a object? where its select object- choose reference point then move? so the method would be select first and second object- select reference points for both (eg center) then enter and they're swapped?  have added a screen shot of how I picture the method going, anything like this already out? and it would be awesome if it didn't work on just blocks but normal objects aswell

0 Likes
1,942 Views
6 Replies
Replies (6)
Message 2 of 7

h_s_walker
Mentor
Mentor

Explore the MIRROR command.

 

Or make a dynamic block with two visibility states one of the twelve tooth gear and one of the six tooth gear. Then all you need to do is change the visibility state.

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

0 Likes
Message 3 of 7

Anonymous
Not applicable

I can do what I described with the mirror command but then its not the 2 step method I was wanting, with mirror you first find center between ref points, easiest way with a line then mirror the 2 objects not keeping the original then have to mirror the 2 objects separately to get the right orientation,with the gears mirror would work because they will look the same no matter which way you mirror, im thinking more along the lines of swapping any object and still keeping original orientation 

0 Likes
Message 4 of 7

h_s_walker
Mentor
Mentor

Try making them as dynamic blocks then.

 

Check the attached drawing. The square and circle are the same block, but just with a different visibility state showing.

 

 

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

0 Likes
Message 5 of 7

tecoe_summage-phillips
Community Visitor
Community Visitor

I hear everyone saying to make it a dynamic block and yes that would work, but I definitely hear where you are coming from. Sometimes there are situations where you wouldn't want to go through the hassle of making a block or mirroring. I found a typo on a print where one line of text was where another should be and vice versa. It would have been nice if there was a swap command to just select the two lines of text and swap their positions.

0 Likes
Message 6 of 7

MMcCall402
Mentor
Mentor

In a dynamic block it could be done like this:

 

Make a point/move (parameter/action) at the center of each of the objects, no grips, chain their actions. 

Then make a flip parameter/action at the midpoint between them, select those point parameters as the selection set. (not the objects)

 

This flips the position of the objects but leaves them oriented just as they were.

 

Example:

 

MMcCall402_0-1752507937707.png

 

.

Mark Mccall 
CAD Mangler


EESignature


VHB - Vanasse Hangen Brustlin, Inc.


Linkedin

0 Likes
Message 7 of 7

j.palmeL29YX
Mentor
Mentor

Some LISP lines should do the job. 

Load the attached (quick and dirty) example and run the SWAP command. 

 

(defun c:swap (/ p1 p2 ss1 ss2)
  (princ "\nSelect first group of objects: ")
  (setq ss1 (ssget))
  (princ "\nSelect second group of objects: ")
  (setq ss2 (ssget))
  (setq p1 (getpoint "\nFirst reference point: "))
  (setq p2 (getpoint "\nSecond reference point: "))
  (command "_move" ss1 "" p1 p2)
  (command "_move" ss2 "" p2 p1)
  (princ)
)

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature