Author Topic: Replacing one block with another  (Read 6419 times)

0 Members and 1 Guest are viewing this topic.

Skeeps

  • Guest
Replacing one block with another
« on: December 15, 2008, 07:13:58 AM »
I have a titleblock that I created. I then updated loads of drawings with it. Bit later on I had to change the logo and now I have to exchange all these drawings with the new titleblock. I don't want to lose the  attributes information I've already creatd for these drawings so I tried Importing the new titleblock in,  however it says 'duplicate definition of A0 Sheet ignored' or something to that effect and the new imported titleblock looks like the old one. anything I can do here?

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Replacing one block with another
« Reply #1 on: December 15, 2008, 07:18:56 AM »
You will want to use the old -Insert Block Name=Block Name trick to insert/replace the old one with the new one.

From Help File



Updating a Block Path: If you enter a block name without a path name, INSERT searches the current drawing data for an existing block definition by that name. If no such block definition exists in the current drawing, INSERT searches the library path. If a file is found, the file name is used for the block name upon insertion of the block definition. The same block definition is used for subsequent insertions of that block. You can replace an existing block definition with an external file by entering the following at the Enter Block Name prompt:
block name=file name

Updating a Block Definition: If you make changes to a block file that is inserted in your drawing and you want to change the existing block definition without creating a new block insertion, enter the following at the Specify Insertion Point prompt (following the Enter Block Name prompt):
block name=

If you enter = after the block name, the following prompt is displayed:

Block "current" already exists. Redefine it? [Yes/No] <No>: Enter y, enter n, or press ENTER

If you choose to redefine the block, the existing block definition is replaced with the new block definition. The drawing is regenerated, and the new definition is applied to all existing insertions of the block definition. Press ESC when prompted for the insertion point if you do not want to insert a new block into the drawing.

« Last Edit: December 15, 2008, 07:22:42 AM by mjfarrell »
Be your Best


Michael Farrell
http://primeservicesglobal.com/

quamper

  • Guest
Re: Replacing one block with another
« Reply #2 on: December 15, 2008, 09:17:40 AM »
If the block is on a tool palette, just right click on it and select redefine. I do that all the time.. even for temporary blocks just drag them on to a palette and them delete them off when no longer needed.

Skeeps

  • Guest
Re: Replacing one block with another
« Reply #3 on: December 15, 2008, 09:26:20 AM »
Mjfarrell I am following your post I want to exchange my block called A1 SHEET that lies within my drawing for one that is in an external file, I've put it within the same folder as the drawing. this is what I get back

Command: -insert Enter block name or [?]: A1 SHEET=WBS
Block "A1 SHEET" already exists. Redefine it? [Yes/No] <N>: Y
Block A1 SHEET references itself
Regenerating layout.
Regenerating model.
*Invalid*


umm confused.

M-dub

  • Guest
Re: Replacing one block with another
« Reply #4 on: December 15, 2008, 09:40:23 AM »
Why not reinsert the updated block, redefining the definition, then use BATTMAN to sync up the attributes?

Skeeps

  • Guest
Re: Replacing one block with another
« Reply #5 on: December 15, 2008, 09:47:09 AM »
could I keep the attribute values that I've already filled out doing that?

M-dub

  • Guest
Re: Replacing one block with another
« Reply #6 on: December 15, 2008, 09:55:49 AM »
Yepper!  :)

(Test it out first)

Skeeps

  • Guest
Re: Replacing one block with another
« Reply #7 on: December 15, 2008, 10:05:54 AM »
maybe that would work. But I think the problem is the blocks are named the same thing. So I have to delete the old titleblock and purge the drawing ( killing the attributes) before I can insert the new block.
Both are named A1 SHEET.

M-dub

  • Guest
Re: Replacing one block with another
« Reply #8 on: December 15, 2008, 10:10:05 AM »
Try the command, DDINSERT and when it asks you if you want to redifine it, say yes.  It should keep the attributes that are already there.  (You don't actually have to insert the block a second time... as soon as you hit 'Yes' to redefine, you can cancel the command and should get the same result)
After that, you can use BATTMAN or ATTSYNC to add the new attribute definitions to the existing block.

M-dub

  • Guest
Re: Replacing one block with another
« Reply #9 on: December 15, 2008, 10:18:16 AM »
When you're using the DDINSERT command, remember to go and browse out to the location of the blocks dwg file instead of just using the definition of the block that already exists in the drawing.

Skeeps

  • Guest
Re: Replacing one block with another
« Reply #10 on: December 15, 2008, 11:17:43 AM »
Yeah okay but I still get this and can't see anything asking me where to redefine it.



Thankyou for your help on this..I'm sorry maybe I'm being a dumbass.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Replacing one block with another
« Reply #11 on: December 15, 2008, 11:22:22 AM »
You need to do something like this:

(command ".-insert" "nameofblock=full\\path\\nameofblock.dwg" '(0 0 0) (command))

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Skeeps

  • Guest
Re: Replacing one block with another
« Reply #12 on: December 15, 2008, 11:35:25 AM »
awww...I tell you what my brain is fried.
Perhaps it's something to do with how I set up the blocks themselves.


M-dub

  • Guest
Re: Replacing one block with another
« Reply #13 on: December 15, 2008, 11:36:20 AM »
Give this macro a try.  You'll have to change it up a bit to suit the block you're using.

Code: [Select]
^C^C-insert;drawing1=C:/drawing1.dwg;\;;;[color=red];;;[/color]^CATTSYNC;N;DRAWING1;
a) replace DRAWING1 with the name of your block
b) replace C:/ with the path TO your block
c) count how many attributes your block contains and put that many semicolons in place of where you see the three red ones.

(hope that makes sense...)

M-dub

  • Guest
Re: Replacing one block with another
« Reply #14 on: December 15, 2008, 11:37:16 AM »
Just a stab in the dark here, but it looks like you could have a definition of that block inside itself.