The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 AutoCAD
 Lisp & Other Handy Files
 Delete Block by Name

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Attach a File

Check here to subscribe to this topic.
   

T O P I C    R E V I E W
BK Posted - March 29 2003 : 10:03:38 AM
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
15   L A T E S T    R E P L I E S    (Newest First)
Admin Posted - August 16 2008 : 9:23:48 PM
Thank you... I've updated the lsp file... it will be correct on the next update...
n/a Posted - August 16 2008 : 8:10:58 PM
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
Admin Posted - January 06 2005 : 10:39:30 PM
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

n/a Posted - January 06 2005 : 7:25:58 PM
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.
n/a Posted - January 06 2005 : 7:21:58 PM
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 !!!
Admin Posted - January 06 2005 : 7:00:42 PM
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
n/a Posted - January 06 2005 : 6:53:22 PM
Is there a way of scripting the unloading of the Lisp routine, so that it will load afresh with each drawing?
Admin Posted - January 06 2005 : 4:57:08 PM
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
n/a Posted - January 06 2005 : 4:37:28 PM
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.
Miksteele Posted - January 05 2005 : 5:12:00 PM
Is DELBLK loaded successfully?
n/a Posted - January 05 2005 : 5:09:43 PM
Nope! Doesn't delete the block... Still a mystery!
Miksteele Posted - January 05 2005 : 1:15:37 PM
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
Miksteele Posted - January 05 2005 : 1:02:40 PM
WAIT A MINUTE... You're right. What the ???

It deletes it, but errors out.
Miksteele Posted - January 05 2005 : 12:55:26 PM
What does your USER SCRIPT look like Mine is shown below:

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

;END SCRIPT
n/a Posted - January 05 2005 : 01:56:20 AM
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?

The Hurricane Forum © 2009 - 2021 Go To Top Of Page
This page was generated in 0.21 seconds. Snitz Forums 2000