View Full Version : How do I get 'copy' macro to end by selecting the newly copied item?
24th Jan 2012, 12:27 pm
Hi, I'm a new poster currently trying to speed up the production of my pre-cast floor drawings.
What I want to do is to select a dynamic block (already inserted into the drawing) and press a button to insert a copy of it, a set distance away from the original. I then want the newly created block to be selected, so that I can press the button again, or press another button (set to another distance) to produce another copy; and so on.
I am struggling to get the new block to be selected at the end of the macro. I have tried using single selection, and Last; but the block does not stay selected.
Can anybody out there help please?
My current script is : ^C^Ccopy;D;@0,521
24th Jan 2012, 02:31 pm
A script will be no use for this - it will have to be a macro assigned to a toolbar etc.
The above script will always copy the block to the same relative position - is this what you want?
Rather than try Last, use Previous.
24th Jan 2012, 02:43 pm
Thanks for the reply.
This will be a macro assigned to a button on a toolbar.
The blocks represent pre-cast concrete floor units which go in at regular spacings. Each unit is spaced a set distance from the last one inserted. There are 3 standard spacings (525, 300, or 128 so I will have 3 buttons.
So, I want to select a block, press a button to insert a copy, say 525 away; then have the new block already selected, so that I can then insert another new block by pressing a button, say 525 (or 300 or 128 away from that one.
At the moment I have to select, press button, select new unit, press button... etc.
24th Jan 2012, 02:45 pm
Would an array (acad 2012) or dynamic block be worth while option to look at?
24th Jan 2012, 02:50 pm
The block being inserted is a dynamic block, which is usually exactly the same as the first, but often will require the length being changed, and then copying can continue.
I do use arrays; but when there are restrictions as to where the blocks can be placed, this can be counterproductive. Sometimes it is quicker to insert the blocks individually to avoid columns, or drainage penetrations.
Hence the requirement to select a unit, then copy, copy, copy, copy, without reselecting every time.
24th Jan 2012, 03:37 pm
See if this works for you; I used a toolpallete to work on (saves reloading the CUI file with each tweak).
This could be done with more finesse with LISP, but we work with LT.
Best I can come up with for you. Hope it helps.
Cancel all current or previous commands
Copymode set to single copy
Copy command starts, picks last object
D (displacement) sets the last point picked as the co-ords to copy from
Copies the object by 1000 (x) & 0 (y)
Resets copymode back to multiple.
24th Jan 2012, 04:45 pm
Many thanks for your help JGA. It's a step closer to what I am trying to achieve. It will certainly help until I can get things as I'd really like them.
It does work, but not quite as I had intended. The problem is that if I add a dimension or any other object, the 'Last' selects that object, rather than the block I wish to start copying from.
Ideally I would select first, then copy, copy, copy etc.
24th Jan 2012, 04:47 pm
24th Jan 2012, 04:53 pm
That doesn't seem to work.
24th Jan 2012, 05:20 pm
I've modified your code and I think it's solved the problem.
The new code is
So I select my block, run the macro which copies the block (using previous),then selects the new block using 'Last', which is then re-selected when I run the macro again. I think...
Thanks again, so far so good.
13th Feb 2012, 01:58 pm
Using the "Command" in lisp reverts to the origional single copy mode. My "Copy Once" Macro: (COMMAND "COPY") works before or after selection.
Powered by vBulletin™ Version 4.1.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.