Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Batch Replace Blocks

1 REPLY 1
Reply
Message 1 of 2
Anonymous
1031 Views, 1 Reply

Batch Replace Blocks

Hi All,

We've recently converted all our microstation drawings to autocad now that the company has decided to go with one cad program company wide.

 

One of the issues we are having after getting the drawings back from the this co. converting them is the cells to blocks convertion inside the drawing.

 

when we open a drawing and see a "Fuse" block for instance and if it a has multiple inserts, it named them:

Fuse

Fuse_1

Fuse_2 etc....

 

is there a lisp routine or some command that would replace the "Fuse_*" blocks with "Fuse"

I've been searching the forums and know about the express tool Replace Block but need to be able to automate somehow.

I thought about trying to rename each of the "Fuse_*" but of course it won't let you rename to a block name that already exists...thanks in advance for any help!!

1 REPLY 1
Message 2 of 2
EC-CAD
in reply to: Anonymous

I developed a routine a few years ago that swaps blockname for \path\newblockname.

Basicly, has a text based 'table' of oldblockname newblockname #attributes rotate Y/N.

Reads that table for each drawing, selects all 'Inserts', gets their name. IF the name is on the list, removes

the old block, inserts replacement block in same insertion point, at same scale factor, and rotation.

I use it to replace IEC controls components with ANSI or visa/versa. It needs to be 'tuned' to a particular 'set'

of drawings, but does a decent job of swapping them out. After swapping in the new block, it purges Blocks.

So, the resultant drawing just has a 'clean' set of blocks (if built correctly).

I'll share / configure the routine if you like. E-Mail:   ec-cad@centurytel(dot)net

'remove the dot, replace with .

 

Bob

EC-CAD

 

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

Post to forums  

Autodesk Design & Make Report

”Boost