Redefine block, like Design center & Toolpalettes, from a single source DWG

Redefine block, like Design center & Toolpalettes, from a single source DWG

roland.r71
Collaborator Collaborator
1,148 Views
4 Replies
Message 1 of 5

Redefine block, like Design center & Toolpalettes, from a single source DWG

roland.r71
Collaborator
Collaborator

We have massive numbers of blocks (electrical schematic symbols), divided into a few tool palettes, with a single DWG containing all blocks for a palette. De DWG containing the source blocks was created with Design Center.

 

Now I can open Design center, browse to the dwg, see all blocks inside it, right click a block and click "Redefine".

I can go to the Tool palette, look up the symbol, right click it and choose "Redefine", too.

 

...but I can't figure out how to do that from lisp...

 

-insert blockname=dwgname doesn't work for this , and i'm NOT going to create hundreds of WBLOCKS. Besides being way to much work it would kinda defeat the purpose of the Design Center and tool palettes.

 

As the design center & tool palettes show, AutoCAD is internally very well capable of doing so, but how to do it from LISP???

 

So, in short, I have a dwg file, containing a block & I want to update my current drawing with that blocks definition.

 

The reason for it has to do with updating the blocks. First I need to check the current definition's attributes, as some changes have been made there over the years. Some even contain double tag names, which I need to repair before redefining it with the correct versions. I would like to write a function to check the current drawing (set of layouts full of symbols), repair the old versions & redefine them if needed.

Doing so by hand is a tedious job.

 

 

0 Likes
1,149 Views
4 Replies
Replies (4)
Message 2 of 5

SeeMSixty7
Advisor
Advisor

Exporting your blocks to single files using WBLOCK would be a very good idea. Design Center offers some great benefits, and having them all in one file does make it pretty convenient to use the Design Center Interface, but it also limits you in ways too. A single source file for all your blocks is actually putting all your eggs in one basket.

 

It is not difficult to create a simple routine to write out all your blocks to a folder.

 

With the blocks as individual files, it is the easy to use INSERT equals to redefine your blocks in other drawings.

 

Managing the blocks and updates that can happen can be a task. If you are a single person shop then no worries, easy to manage. If you add 2, 10, 20, 50+ then it can become a challenge. I use an integrated system I developed to manage block updates. Pretty basic really. Store block centrally, use local copies, log any changes and update any drawing files opened locally with new versions of blocks. The system itself can be complicated to develop, but the gist is pretty simple.

 

Good luck,

 

 

0 Likes
Message 3 of 5

roland.r71
Collaborator
Collaborator

The WBLOCK path is one I can't follow. I'm not the one to create and maintain the blocks & tool palettes.

The tool palettes are configured to auto update. So any new versions of the blocks and/or tool palettes are automatically distributed to all people.

 

The redefining is usually done by using the tool palette. (right click, redefine (if it's present in current drawing))

The source for that is a single DWG (1 for each palette) - which is read only to all but one.

 

To do it with wblocks, HE would have to run the export routine each and every time he changes something.

-or- I must copy the source file, create the wblock(s) on the local machine, then use that for updating & delete the wblocks again when done.

 

...which is impossible to do from another, active, drawing - next to all sorts of other problems I have with such construction.

 

So, if can't find how AutoCAD does it with the tool palettes, which can redefine the blocks coming from 1 source dwg without problems, I can NOT automate the repair process. (& redefining remains a potential disaster, as most people using AtouCAD over here have no clue on how to handle block definitions, or that you start losing stuff if attribute tag names are not the same. etc, etc.

0 Likes
Message 4 of 5

SeeMSixty7
Advisor
Advisor

I don't believe you will be able to get a design center solution.

 

You might try looking into AutoLISP and ObjectDBX.

 

It's pretty easy to get it to pull a block definition from another drawing like design center does, but it gets a bit more complicated when you start looking into redefining a block.

 

Here is something I found when I started digging into trying to redefine a block using ObjectDBX.

 

https://www.thecadforums.com/threads/first-attempt-at-object-dbx.29915/

 

Your concerns about attributes and block redefining won't get any easier using design center or any other method, add in dynamic blocks and it gets even more fun. I would highly recommend educating your users to understand all the concepts and steps. It will make your group better and raise your groups ability and quality. I do of course understand the challenges in that path though too.

 

Good luck,

0 Likes
Message 5 of 5

roland.r71
Collaborator
Collaborator

@SeeMSixty7 wrote:

I don't believe you will be able to get a design center solution.

 

You might try looking into AutoLISP and ObjectDBX.

 

It's pretty easy to get it to pull a block definition from another drawing like design center does, but it gets a bit more complicated when you start looking into redefining a block.

 

Here is something I found when I started digging into trying to redefine a block using ObjectDBX.

 

https://www.thecadforums.com/threads/first-attempt-at-object-dbx.29915/

 

Your concerns about attributes and block redefining won't get any easier using design center or any other method, add in dynamic blocks and it gets even more fun. I would highly recommend educating your users to understand all the concepts and steps. It will make your group better and raise your groups ability and quality. I do of course understand the challenges in that path though too.

 

Good luck,


Yeah, i almost gave up on the idea, but there might be a way to do it ...

 

Rename the "old" block, make some changes, import the new block from external drawing, swap the old block with the new block, purge the old block's def. That way i would avoid a lot of problems with dynamic blocks too, and about 50% of them are.