Jump to content

Delete a Block


Recommended Posts

Posted

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.

Posted

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

  • 8 months later...
Posted

is there a way to select all empty blocks at one time?

Posted

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)

Posted

Put this lisp dont delete that blocks

Just listing that blocks

Posted

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

Posted

hotrodz0321

 

That what I am doing but using BEDIT,

I am searching for a lisp doing that for entire drawing

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...