Overwrite/Redefine block with lisp

Overwrite/Redefine block with lisp

Anonymous
Not applicable
1,043 Views
2 Replies
Message 1 of 3

Overwrite/Redefine block with lisp

Anonymous
Not applicable

I have done edits to a block on my network that already exists in multiple drawings.  Aow when I pick the command to insert the block from my toolbar, which still has the same name which exists in the current drawing database, I need it to go out to my folder and to insert the new occurence of the block and redefine it for the places it currently exists.

That's all very easy to do if I manually go to insert it by browsing to it, and Autocad will ask me "Do you want to redefine it?", at which point I answer Yes.  But I need to be able to put that whole process in a lisp string to do it automatically.

 

Right now if Autocad sees the block already in the drawing, it's going to insert it from the drawings database, and not go out and grab the new one.  I only seem to be able to do it if inserting it manually.

 

Hope that makes sense?  If anybody knows how to do that, I would appreciate it.

 

Thx.

Doug

0 Likes
1,044 Views
2 Replies
Replies (2)
Message 2 of 3

norman.yuan
Mentor
Mentor

For question on LISP, you'd stand a better chance to get answer if you post in LISP forum.

 

With that said, here is a solution: in your LISP string used behind the toobar button (still toolbar, not ribbon?), you simply specify the block name like 

 

BlockName=file_path.

 

The Lisp string may look like:

 

(command "._insert" "myBlock=C:\\my blocks\\myBlock.dwg" pause pause pause pause)

 

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 3

Anonymous
Not applicable
Thanks. I'll give that a try!
0 Likes