Looking for a LISP to replace blocks

Looking for a LISP to replace blocks

amscottAF3BX
Explorer Explorer
978 Views
5 Replies
Message 1 of 6

Looking for a LISP to replace blocks

amscottAF3BX
Explorer
Explorer

Hello, 

I am looking to find a lisp that will replace multiple different named blocks, or selected blocks, with a new one i have created. In this case I am working with very old data and have a multitude of "door" blocks from tons of different drawings and naming schemes and want to replace them all. 

I have more blocks besides doors to do as well but I need a structure I can build from and reuse. 

Thanks to whoever can help.

0 Likes
Accepted solutions (1)
979 Views
5 Replies
Replies (5)
Message 2 of 6

pendean
Community Legend
Community Legend
@amscottAF3BX There are dozens of LISP that do just that: have you had a chance to look and try, and determine what does or does not work for you by chance?
https://www.google.com/search?q=autocad+custom+lisp+to+replace+blocks

https://apps.autodesk.com/ACD/en/List/Search?isAppSearch=True&searchboxstore=ACD&facet=&collection=&...


0 Likes
Message 3 of 6

Kent1Cooper
Consultant
Consultant
Accepted solution

I have a BRS command [= Block Replace, Selected] defined in BlockReplace.lsp, >here<, that has you give it a Block name to replace things with, and select as many Blocks as you want, of any name(s), and it replaces them, with each replacement using the same scales and rotation as what it's replacing.  But given your description, I expect not all of your door Blocks will have been defined in the same way -- when Inserted at scale factors of 1 and rotation of 0, do their door leaves all aim in the same direction, and do their swing arcs all proceed the same way from there, and might some be defined at unit size so that the door width is the scale factor, and others defined for a particular door width?  If there are variants in such properties, BRS will result in doors that need to be rotated and/or mirrored and/or scaled to have them sit correctly in their openings.

Kent Cooper, AIA
0 Likes
Message 4 of 6

amscottAF3BX
Explorer
Explorer

This is exactly what I was looking for. There is the issue you mentioned with rotations and scaling being off. These drawings I'm working with have had many masters before me. 

Thank you for your command! 

0 Likes
Message 5 of 6

amscottAF3BX
Explorer
Explorer

I did look through some of the ones available all over the place. I figured maybe I would get one that worked better or was different in ways that were helpful, so I asked. Those links are super helpful as well! Thank you so much! 

0 Likes
Message 6 of 6

MisterSmiley
Community Visitor
Community Visitor

Hi Kent,


When I use your lisp loaded from the startup suite, it returns - Error: bad argument type: stringp nil, but when I load it manually it runs fine. 
Do you experience the same behavior or have I got a conflicting lisp?

EDIT: Never mind me, at some point I'd added it to my acaddoc.lsp file and once I removed it from there it works fine when loading with the startup suite.

Kind regards,
Smiley

0 Likes