TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: hudster on February 14, 2004, 09:24:27 AM

Title: Can someone post a copy of delnul.lsp
Post by: hudster on February 14, 2004, 09:24:27 AM
I've accidentally deleted my copy and I can't find it anywhere on the net. :oops:

Cheers

Andy
Title: Can someone post a copy of delnul.lsp
Post by: Keith™ on February 14, 2004, 10:10:03 AM
What is it supposed to do?
Title: Can someone post a copy of delnul.lsp
Post by: JohnK on February 14, 2004, 10:34:35 AM
is it still in your recycle bin?
Title: Can someone post a copy of delnul.lsp
Post by: hudster on February 14, 2004, 01:53:23 PM
Nah it's gone for good, I've checked and I couldn't get it back.

it's a lisp routine that deletes null objects from a drawing, empty text strings etc.

It was handy for cleaning up Architects layouts we receive.
Title: Can someone post a copy of delnul.lsp
Post by: Kerry on February 14, 2004, 02:11:17 PM
Let Google be your friend.

CADALYST  December 1997
Tip1390.LSP: DELNUL.LSP Delete Null Entities (Bill Fane)

Is this the routine ??


Code: [Select]

;; 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)

Title: Can someone post a copy of delnul.lsp
Post by: hudster on February 14, 2004, 03:17:35 PM
Yip thats it.

Strange though, i searched on cadalyst and didn't find anything.