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

 All Forums
 AutoCAD
 Lisp & Other Handy Files
 Delete Block by Name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

BK
Super User

36 Posts

Posted - March 29 2003 :  10:03:38 AM  Show Profile  Visit BK's Homepage  Reply with Quote
Just type in the name of the block to delete and whammo...

(Works wickedly with Hurricane across multiple files)

You also might want to follow this one up with a PURGE

Download Attachment: delblk.zip
1.06 KB

Bill
http://www.74mph.com
Hurricane for AutoCAD

n/a
deleted

13 Posts

Posted - January 05 2005 :  01:56:20 AM  Show Profile  Visit n/a's Homepage  Reply with Quote
Have used this before, but unfortunately, it doesn't work now??

Command: delblk
ษอออออออออออออออออออออออออออออออออออออออออออออออออออออออออป
บ This routine will delete a specified block บ
บ from the current drawing regardless of how many บ
บ are nested in the drawing. บ
บ บ
บ The speed at which the block is deleted is บ
บ determined by the size of the drawing, so be patient. บ
ศอออออออออออออออออออออออออออออออออออออออออออออออออออออออออผ
Enter block name to delete ... Construc
0; error: too many arguments

Any ideas folks?
Go to Top of Page

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - January 05 2005 :  12:55:26 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
What does your USER SCRIPT look like Mine is shown below:

;BEGIN SCRIPT
(LOAD "$HUR_PATH$LISP/DELBLK.LSP")
DELBLK
"myblockname"
N

;END SCRIPT

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - January 05 2005 :  1:02:40 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
WAIT A MINUTE... You're right. What the ???

It deletes it, but errors out.

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - January 05 2005 :  1:15:37 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
ALRIGHT... I'm not sure what happened there. Mine works now. You'll see what I did below. Does that fix yours

;BEGIN SCRIPT
(LOAD "Z:/Hurricane/LISP/DELBLK.LSP")
DELBLK
"CHECKPRINT"
N

;END SCRIPT


;REAL END OF SCRIPT

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

n/a
deleted

13 Posts

Posted - January 05 2005 :  5:09:43 PM  Show Profile  Visit n/a's Homepage  Reply with Quote
Nope! Doesn't delete the block... Still a mystery!
Go to Top of Page

Miksteele
Hurricane-Extreme User

USA
216 Posts

Posted - January 05 2005 :  5:12:00 PM  Show Profile  Visit Miksteele's Homepage  Reply with Quote
Is DELBLK loaded successfully?

Mike Fischer
Fischer Design Group, LLC
Building Model Coordination - Steel Detailing - Connection Design
www.FischerDesignGroup.com
Go to Top of Page

n/a
deleted

13 Posts

Posted - January 06 2005 :  4:37:28 PM  Show Profile  Visit n/a's Homepage  Reply with Quote
Yes, when I use it for scripting, I actually load it at AutoCad start up, but have tried loading it with each drawing as well. I know it worked before, I had to update several hundred title-blocks 6 months ago. Then it was simply a matter of delblk the old titleblock and insert the new. I still have the script I used...

I've tried all sorts of things now, including unloading delblk and loading it for each drawing, with and without inverted commas, all capitals, all lowercase, etc. Nothing seems to be working.

I've already just gone ahead and manually removed the offending block (a "Issued for Construction" stamp), so I can begin the redlines.
Go to Top of Page

Admin
Administrator



652 Posts

Posted - January 06 2005 :  4:57:08 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
If I may jump in here... with an observation I have made a number of times when using lisp routines-a-plenty.

If "by chance" you happen to load a different lisp routine that happens just-so-happens to have a sub-routine or variable with the same name, defined in any of your other lisps, you *might* have strange problems. I know this sounds CRAZY , but I've proven it true to myself, and others many a time.

What I recommend you do (as either a test, or as common practice), is UNLOAD all lisp routines that you are not using, or suspicious of), and only ever load the ones you want to use, only each time you go to use them.
(or another thing is, when I have a problem lisp, and I suspect there is a routine conflict, I'll go into the lisp and rename the routine something "random", and take a look at the variable names (sometimes renaming them too), so that I can't ever get a conflict.

I know this sounds hokey, but I've trouble-shot a few "weird/transient" problems this way.

This may not solve your problem, but it is worth a shot.

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

n/a
deleted

13 Posts

Posted - January 06 2005 :  6:53:22 PM  Show Profile  Visit n/a's Homepage  Reply with Quote
Is there a way of scripting the unloading of the Lisp routine, so that it will load afresh with each drawing?
Go to Top of Page

Admin
Administrator



652 Posts

Posted - January 06 2005 :  7:00:42 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Good question..

To the best of my knowledge, No. I've done some digging to double-check, and unless I'm missing something, there ISN'T an UNLOAD command for lisp. You must open the appload dialog box and click the unload button.

There is an ARXUNLOAD, and VBAUNLOAD however.

Hope this helps,
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

n/a
deleted

112 Posts

Posted - January 06 2005 :  7:21:58 PM  Show Profile  Reply with Quote
I think Bill is correct about no command to unload lisp as the other file types. Under "Options" in AutoCAD, however, under "System" and "General Options", there is the option to turn on or off the loading of lisp with each drawing as opposed to once for an editing session. (I don't know if that was part of the original question, or not.) Also, if you know what lisp you want to "unload", I think, though you will need to verify this with someone smarter than me, that you might be able to use lisp at the beginning of your script to set the lisp equal to nil, in effect "unloading" it ???????? For example, if you generally type "DELBLK" to start the lisp, it is most likely defined as "C:DELBLK" in the lisp program. Would entering "(setq "C:DELBLK" nil)", without the outer quotation marks as the first line of your script, possibly undefine or unload the lisp? Similarly, if you type "(delblk)" to begin the lisp program, could you use "(setq "delblk" nil)" without the outer quotation marks as the first line of your script, possibly undefine or unload the lisp? Note, I'm just speculating here. I've never tried it, but I seem to vaguely remember having read something to that effect. I'll leave it to Bill or some other expert to check it out further, if they feel there might be merit. If this method worked, then you could reload the lisp you actually want with the full path to eliminate any conflicts ?????????? You know, I think if you load the lisp with the full path at the beginning of your script, it will redefine any conflict, anyway, won't it, so that the one you want will run when called from the script?

I hope I'm not wasting your time with my thoughts !!!

Steve Bubendorf
Go to Top of Page

n/a
deleted

13 Posts

Posted - January 06 2005 :  7:25:58 PM  Show Profile  Visit n/a's Homepage  Reply with Quote
If only "QSELECT" had a command line option... I have been digging around Lisp the last couple of days and perhaps I could write a single line to select the offending block and then use the erase command, similar to your example to update a block.
Go to Top of Page

Admin
Administrator



652 Posts

Posted - January 06 2005 :  10:39:30 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Hi PACE,

There are a couple of options...

There is a lisp that has similar functionality. It is a little strange to use though.

Check it out here...
http://www.74mph.com/forum/topic.asp?TOPIC_ID=82&SearchTerms=ssx
It might be useful, might not...

The trick to writing this into a script, is you have to perform a SELECT ALL, then CANCEL before you invoke the SXX command. Then when SXX asks you for the selection set, specify LAST Selection Set.

You'll have to work through it manually a couple of times, there is the ability to create a selection set by specifing the block name, I believe. I haven't used it in ages, so I'm just going on memory.

I wish I could help you with lisp a bit more... but I'm no expert on it. Take a look around on the net some more, and I'm sure you will find something that will suit your needs. (Just don't forget to post the solution back here!)

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

n/a
deleted



1 Posts

Posted - August 16 2008 :  8:10:58 PM  Show Profile  Reply with Quote
I found what generating the error.

The problem is in the Lisp file
There is a line that’s look like this:
(prompt " blocks deleted”\n)

It should look like this:
(prompt " blocks deleted\n")

/ JeJo
Go to Top of Page

Admin
Administrator



652 Posts

Posted - August 16 2008 :  9:23:48 PM  Show Profile  Visit Admin's Homepage  Reply with Quote
Thank you... I've updated the lsp file... it will be correct on the next update...

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
  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.31 seconds. Snitz Forums 2000