Author Topic: Update block  (Read 1723 times)

0 Members and 1 Guest are viewing this topic.

Fabricio28

  • Swamp Rat
  • Posts: 670
Update block
« on: January 09, 2014, 08:23:38 AM »
Hi guys,

Happy New year and best wishes!!

I've created a block (WBLOCK) and I inserted it in a drawing.
So I needed to modify something in the block. But the block inside the drawing didn't update.
I had to inserted it again to redefine the block.

How I can update the block in the drawing without insert it?


dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Update block
« Reply #1 on: January 09, 2014, 12:22:46 PM »
You can't, or at least not without some effort.  Inserting the block prompts the user if they want to redefine the block - changing the definition is what changes the block.  There's only two ways of changing the block definition, either using the built-in insert system or use code to programmatically alter the entities in the definition.

If you *really* need to update it like that, consider using an XREF rather than a block reference.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

Fabricio28

  • Swamp Rat
  • Posts: 670
Re: Update block
« Reply #2 on: January 09, 2014, 01:15:40 PM »
Hi dgorsman,
Thank you for replay

Quote
If you *really* need to update it like that, consider using an XREF rather than a block reference.

I don't really need this.
I was wondering if there is a autocad command to update the block.

Regards
Fabricio

kentium3k

  • Newt
  • Posts: 54
  • Adopt a Greyhound! No, not a bus.
Re: Update block
« Reply #3 on: January 09, 2014, 03:37:54 PM »
You could automate it if it is just one block.

(command "-insert" "test1=" "y" ^C^C)

Where test1 is the name of your block.  This assumes the block is in a folder in your search path.

If not you can include the file search path.
« Last Edit: January 09, 2014, 03:47:54 PM by kentium3k »
Prosperity is only an instrument to be used, not a deity to be worshiped. C. Coolidge

Fabricio28

  • Swamp Rat
  • Posts: 670
Re: Update block
« Reply #4 on: January 10, 2014, 07:10:36 AM »
Wow!!!

Good kentium3k!!!

Simple code, but worked perfectly.

Thanks

Rob...

  • King Gator
  • Posts: 3824
  • Take a little time to stop and smell the roses.
Re: Update block
« Reply #5 on: January 13, 2014, 07:58:30 AM »
Alternatively, you could edit it from within the drawing using the block editor. You can save it out to the block file from there as well as save it in the drawing.
CAD Tech

HasanCAD

  • Swamp Rat
  • Posts: 1422
Re: Update block
« Reply #6 on: January 16, 2014, 07:46:33 AM »
What about using Design Center?

Fabricio28

  • Swamp Rat
  • Posts: 670
Re: Update block
« Reply #7 on: January 20, 2014, 08:58:41 AM »
Thank you guys,

You helped me a lot.

I really appreciated all those suggestions.

Regards
 :-D