The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Hurricane for AutoCAD
 Tips and Tricks
 How to DELETE a block from all drawings...
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Admin
Administrator



651 Posts

Posted - March 27 2002 :  5:43:27 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Have you ever wanted to go through all your drawings and ERASE a particular block... maybe it was a bad title-block, or a bad company logo, or you just don't need a date/time stamp anymore.

Well, here is a handy lisp file that works excellently with Hurricane.

http://www.74mph.com/lisp/delblk.zip

When you run DELBLK from the command line, then just give it the name of the block you want to blow-away. It will go through and ERASE all instances of it (very quickly too)

<i>If you want delete a block, but don't know WHAT the name of the block is, then just select the block and type "LIST", there you should get your AutoCAD "Text Window", or scrollback buffer. And the contents should look something like this...</i>

Command: LIST
1 found
BLOCK REFERENCE Layer: 0
Space: Model space
Handle = 80C
DEMOBLOCK1 <i><-- This is the block name !!</i>
at point, X= 0.0000 Y= 0.0000 Z= 0.0000
X scale factor 1.0000
Y scale factor 1.0000
rotation angle 0
Z scale factor 1.0000

From this example, the block is called DEMOBLOCK1, so this is what you would type at the DELBLK prompt when asked for the block name.

So here is an example you can cut and paste into Hurricane using DEMOBLOCK1 above... (of course you would change the name from DEMOBLOCK1 to whatever your block name is!)

<font face='Courier New'>;BEGIN SCRIPT
(LOAD "DELBLK.LSP") <i>(assuming delblk.lsp is in your AutoCAD path)</i>
DELBLK
DEMOBLOCK1
;END</font id='Courier New'>

And say goodbye to DEMOBLOCK1... As simple as that...

<i>NOTE: You might want to follow this script-up with a PURGE script to make sure the sucker is out of your drawing for good.</i>

Hope this helps!!

Regards,
Bill

mbicm
New Member

13 Posts

Posted - January 16 2008 :  08:55:15 AM  Show Profile  Visit mbicm's Homepage  Reply with Quote
i dunno if you wrote the lisp routine, bill but i get an error.

enter block name to delete ... CPM
0; error: too many arguments

Go to Top of Page

Admin
Administrator



651 Posts

Posted - January 16 2008 :  09:12:25 AM  Show Profile  Visit Admin's Homepage  Reply with Quote
Hmm... yes, seems that it does throw an error for me too... BUT the blocks are deleted.
(if you don't see them deleted, just REGEN)

Regards,
Bill

Hurricane for AutoCAD
http://www.74mph.com
FAQ at
http://www.74mph.com/faq/faq.html
Tutorials at
http://www.74mph.com/tutorials.html
Go to Top of Page

mbicm
New Member

13 Posts

Posted - January 16 2008 :  09:47:46 AM  Show Profile  Visit mbicm's Homepage  Reply with Quote
hmm.. now that you mention it, they are deleted (i was deleting blocks with nothing in them so i couldnt see the results)

its too bad this dont work with nested blocks. i got some of these empty blocks inside blocks...
Go to Top of Page

n/a
deleted

112 Posts

Posted - January 16 2008 :  10:20:33 AM  Show Profile  Reply with Quote
Bill,
I'm under the gun, and can't take time to check this out, but I've got this lisp routine that deletes "nul" blocks. I'm not sure if that is the same as "empty" blocks or not. Also not sure if it does nested blocks.

I thought I'd post it in case you had time to run a test and see if it might be of use here. (It originally did nul text/mtext also, but I commented that out so as not to remove more than is intended here.)

Download Attachment: Delnulblocks.zip
1.66 KB

Steve Bubendorf
Go to Top of Page

mbicm
New Member

13 Posts

Posted - January 16 2008 :  10:41:16 AM  Show Profile  Visit mbicm's Homepage  Reply with Quote
invalid or corrupt zip file
Go to Top of Page

n/a
deleted

112 Posts

Posted - January 16 2008 :  10:44:26 AM  Show Profile  Reply with Quote
I'm sorry !! The file needs to be renamed from .zip to .lsp. The forum's security doesn't like .lsp files outright. "Delnulblks" will run the lisp after it is renamed. Be sure to check it out on test files, though !!

Steve Bubendorf
Go to Top of Page

mbicm
New Member

13 Posts

Posted - January 16 2008 :  1:51:11 PM  Show Profile  Visit mbicm's Homepage  Reply with Quote
i think you removed the deleting part from the lsp.
it found the block and says it needs purging but it didnt delete it.
Go to Top of Page

n/a
deleted

112 Posts

Posted - January 16 2008 :  2:07:03 PM  Show Profile  Reply with Quote
I didn't write the lisp so I'm not certain, but I think it looked like it should have erased the block, but probably did not purge it. I've modified the attached file a little, hoping that the mods would purge the blocks, also. If it does not do that for you as furnished here, I don't think I will be able to do much more with it. It would be great to hear in a few minutes that it worked for you, though ! Good luck !!

Download Attachment: Delnulblocks.zip
1.72 KB

Steve Bubendorf
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Hurricane Forum © 2009 - 2021 Go To Top Of Page
This page was generated in 0.22 seconds. Snitz Forums 2000