View Full Version : Delete a Block
Broydhouse
13th Feb 2008, 03:33 pm
I am working on a drawing that i have had sent over and it has some
blocks that are empty. I can't rember how to delete the whole block.
NBC
13th Feb 2008, 03:49 pm
if you know the name of the block, use QSELECT, and use Block as your Object Type, in Properties choose Name, in Operator choose Equals, in Value insert the name of your block.
once happy with all that, press ok, then once they have all been selected, press Delete key
asos2000
9th Nov 2008, 02:24 pm
is there a way to select all empty blocks at one time?
lpseifert
9th Nov 2008, 02:33 pm
Maybe this will work for you.
; Delete Null Objects
;; DelNul.lsp
;; Deletes nul lines of Text, Mtext & Blocks.
;; Modified by JL Thomas 12/02/97
(Defun C:DelNul ( / TXT BLK NB NAMES)
(if(setq TXT (ssget "X" '((-4 . "<and")(-4 . "<or")
(0 . "MTEXT")(0 . "TEXT")
(-4 . "or>")(-4 . "<or")
(1 . "")(1 . " ")(1 . " ")(1 . " ")
(1 . "{}")(1 . "{ }")(1 . "{ }")(1 . "{ }")
(1 . "{}\P")(1 . "{ }\P")(1 . "{ }\P")(1 . "{ }\P")
(-4 . "or>")(-4 . "and>"))))
(progn
(command"_erase"TXT"")
(princ(strcat"\n "(itoa(sslength TXT))" nul text strings deleted. "))
)
(princ"\n No nul text strings found. "))
(setq BLK(tblnext"BLOCK"T)NAMES nil)
(while BLK
(if(=(cdr(assoc 0(entget(cdr(assoc -2 BLK)))))"ENDBLK")
(progn
(if(setq NB(ssget "X" (list(assoc 2 BLK))))
(command"_erase"NB"")
)
(setq NAMES(cons(cdr(assoc 2 BLK))NAMES))
)
)
(setq BLK(tblnext"BLOCK"))
)
(if NAMES
(progn(textscr)
(princ"\n Nul blocks found and need purging: ")
(foreach X NAMES(princ"\n ")(princ X))
)
(princ"\n No nul blocks found. ")
)
(princ)
)
(c:DelNul)
asos2000
9th Nov 2008, 02:42 pm
Its great
Thanks lpseifert
asos2000
10th Nov 2008, 09:57 pm
Put this lisp dont delete that blocks
Just listing that blocks
hotrodz0321
10th Nov 2008, 10:48 pm
draw something (a line or any easily visible object) and create a block out of it but name it the same as the block you are trying to delete, it will ask to redefine the block, select yes....all the blocks should then be visible and you can delete them
asos2000
11th Nov 2008, 10:49 am
hotrodz0321 (http://www.cadtutor.net/forum/member.php?u=4943)
That what I am doing but using BEDIT,
I am searching for a lisp doing that for entire drawing
Powered by vBulletin™ Version 4.1.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.