DS-precast Posted January 24, 2012 Posted January 24, 2012 (edited) 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 Thanks Edited January 24, 2012 by DS-precast question mark added Quote
JGA Posted January 24, 2012 Posted January 24, 2012 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. Quote
DS-precast Posted January 24, 2012 Author Posted January 24, 2012 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. Quote
JGA Posted January 24, 2012 Posted January 24, 2012 Would an array (acad 2012) or dynamic block be worth while option to look at? Quote
DS-precast Posted January 24, 2012 Author Posted January 24, 2012 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. Quote
JGA Posted January 24, 2012 Posted January 24, 2012 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. ^C^C_.Copymode;1;_.Copy;L;;D;1000,0;_.Copymode;0 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. Quote
DS-precast Posted January 24, 2012 Author Posted January 24, 2012 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. Quote
JGA Posted January 24, 2012 Posted January 24, 2012 ^C^C_.Copymode;1;_.Copy;/;;D;1000,0;_.Copymode;0 Quote
DS-precast Posted January 24, 2012 Author Posted January 24, 2012 Hi JGA I've modified your code and I think it's solved the problem. The new code is ^C^C_.Copymode;1;_.Copy;P;;D;0,525;select;L;;_.Copymode;0 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. Quote
tombu Posted February 13, 2012 Posted February 13, 2012 Using the "Command" in lisp reverts to the origional single copy mode. My "Copy Once" Macro: (COMMAND "COPY") works before or after selection. Quote
Recommended Posts
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.