Community
AutoCAD LT Forum
Welcome to Autodesk’s AutoCAD LT Forums. Share your knowledge, ask questions, and explore popular AutoCAD LT topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Replace blocks??

17 REPLIES 17
Reply
Message 1 of 18
Anonymous
2725 Views, 17 Replies

Replace blocks??

I have a lot of blocks of same size in a drawing.

I want to replace blocks by clicking on the block I want to replace and then click on the block I want to insert.

The problem is that I can't get the coordinates from the old block. I need the coordinates to insert the new block.

Does anyone know how to do?

It have to work with 2007LT and newer.
17 REPLIES 17
Message 2 of 18
Anonymous
in reply to: Anonymous

INSERT command, manually select the location to place the new block using
any selection method like Ins, INT, END etc. as needed. ERASE the old block.

--
Dean Saadallah
Add-on products for LT
http://www.pendean.com/lt
--
Message 3 of 18
Anonymous
in reply to: Anonymous

Thank you for your answer.

I want to erase the old block by automatic.

I just want to choose the new block to insert and then click on the old block that are already there. When I have inserted the new block then I want autocad to erase the old block by automatic (so I don't have 2 blocks in the same place).

Is it possible to write a macro or script to do this in LT?
Message 4 of 18
rjvs
in reply to: Anonymous

Would the SCALE and ROTATION be constant for
all the BLOCKS involved?
Message 5 of 18
Anonymous
in reply to: Anonymous

... and what about attributes?

--
Dean Saadallah
Add-on products for LT
http://www.pendean.com/lt
--
Message 6 of 18
Anonymous
in reply to: Anonymous

Both SCALE and ROTATION are constant.
Message 7 of 18
Anonymous
in reply to: Anonymous

The old block doesn't have any atributes (or I don't want to keep them). The new block will prompt for new attributes when I use INSERT.
Message 8 of 18
hwalker
in reply to: Anonymous

Do you need the old block at all? If not just redefine the block using your new one as the block and it will automatically replace the block

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

Message 9 of 18
Anonymous
in reply to: Anonymous

I need the old block to know the coordinates of the new block.

ex:
I have drawn alot of pipes (lines work as pipes). I place a dummy valve on a pipe. The dummy valve is the "old block". Someone else opens my drawing and have a library of blocks (different types of valves). He sould be able to click on the dummy and then click on the actual valve he wants. I want autocad to remove the dummy when the new valve is inserted.
Message 10 of 18
rjvs
in reply to: Anonymous

..."click on the dummy and then click on the actual valve..."

implies that the actual valve blocks are already inserted.
If this is correct, one can use COPY and DDATTE which avoids
the complication of getting the actual block NAME into the
macro (unless someone can see a way of doing it without
buying a LISP enabler etc.).
...so, are the blocks already inserted or does the macro have
to INSERT them?
Message 11 of 18
Anonymous
in reply to: Anonymous

The blocks are already inserted. The problem I have is that I want to delete the old block by automatic.

Only the new block on top should be left in the drawing. The old block under should be deleted.
Message 12 of 18
rjvs
in reply to: Anonymous

Here's a macro that works on my machine with LT2007.
You might want to tune it up for your needs or try something
different. I have not used the 'native' command names nor
saved INSBASE... May be better to run with OSMODE=0
(or F3 Key toggle) to avoid unwanted snaps. Also take care
to select NEA on the BLOCKS. This was assigned to a custom
toolbar button...could be adapted to a pull-down menu as well.
-
The first selected block (the dummy) is erased before picking
the replacement one...didn't see an easy way to avoid that
but the replacement goes where you want.
#
^C^Cselect;single;nea;\base;ins;@;erase;p;;select;single;nea;
\lastpoint;ins;@;copy;single;p;@;$M=$(getvar,insbase);
#
The following version goes right into ATTRIBUTE edit.
#
^C^Cselect;single;nea;\base;ins;@;erase;p;;select;single;nea;
\lastpoint;ins;@;copy;single;p;@;$M=$(getvar,insbase);ddatte;l;
#
:) Message was edited by: rjvs
Message 13 of 18
hwalker
in reply to: Anonymous

If you rediefine the block as I've suggested. ALL the old blocks will automatically change to the new block in the SAME location as the old block

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

Message 14 of 18
Anonymous
in reply to: Anonymous

While great macros, they do not capture the deleted block's scale or
rotation, a key requirement by the OP.

To the OP, LT has no such programming ability as I noted in my first reply.
If you want such ability, you will need to spend another +$400 per LT seat
with a 3rd party developer (not me), then learn how to program or find a
freebie for full AutoCAD that will do what you seek.

HWALKER suggest using INSERT command and the naming function of
OLDBLOCKNAME=NEWBLOCKNAME, which works only if you are replacing different
blocks in your file. If you only use one block for all the locations, your
place holder as you note, that will not work either.

--
Dean Saadallah
Add-on products for LT
http://www.pendean.com/lt
--
Message 15 of 18
rjvs
in reply to: Anonymous

..already asked the question about SCALE and ROTATION
to which Lindahl replied,
"Both SCALE and ROTATION are constant."
-
must have misunderstood something...
-
LT has more 'programming' ability than people think,
one has to try and experiment.
The new CAL command is particularly interesting. Message was edited by: rjvs
Message 16 of 18
Anonymous
in reply to: Anonymous

While not an expert I've pushed LT about as far as it will go with macros
and script files, but I would welcome your input in achieving this request
using CAL or other commands: just remember the key is automation, fewer
clicks.

--
Dean Saadallah
Add-on products for LT
http://www.pendean.com/lt
--
Message 17 of 18
Anonymous
in reply to: Anonymous

Thank you very much rjvs. Thats what I was looking for.

Do you know if it's possible to modify the script so I can choose blocks direct from my tool palette?
Message 18 of 18
rjvs
in reply to: Anonymous

That might be possible but sorry...I don't know how.
:)

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

Post to forums  

Autodesk Design & Make Report

”Boost