Jump to content

How do I get 'copy' macro to end by selecting the newly copied item?


Recommended Posts

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



Edited by DS-precast
question mark added
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.




Break down;-

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites



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.

Link to comment
Share on other sites

  • 3 weeks later...

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.

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