Jump to content

HELP: LISP to delete all text, mte & leaders (including within blocks & nested block)


vernonlee

Recommended Posts

1 solution i can think of is creating an updated block for the blocks with hatch etc.

then batch redefine those blocks at once.

would you mind posting/attaching your drawing here with those blocs you mentioned.

Link to comment
Share on other sites

1 solution i can think of is creating an updated block for the blocks with hatch etc.

then batch redefine those blocks at once.

would you mind posting/attaching your drawing here with those blocs you mentioned.

 

Hi bro. Do not quite understand your question.

 

To clarify, i am looking for a clean up drawing routine through LISP.

 

I already have LISP for removing dimensions & hatches. What i still lack is Text, Mtext & leader lines removing LISP.

 

Hope that clarify.

Link to comment
Share on other sites

try this bro, however it does not delete nested object inside blocks.

(defun c:test2(/ cntr eset en cnt)
 (setvar "cmdecho" 0)
 (setq eset
   (ssget"X" 
     (list 
       (cons -4 "<OR")
         (cons 0 "ARC")
         (cons 0 "ATTRIBUTE")
         (cons 0 "CIRCLE")
         (cons 0 "ELLIPSE")
         ;(cons 0 "INSERT")
         (cons 0 "LINE")
         (cons 0 "LWPOLYLINE")
         (cons 0 "MLINE")
         (cons 0 "MTEXT")
         (cons 0 "POINT")
         (cons 0 "POLYLINE")
         (cons 0 "SOLID")
         (cons 0 "TEXT")
         (cons 0 "TRACE")
         (cons 0 "XLINE")
   (cons 0 "LEADER")
   (cons 0 "HATCH")
       (cons -4 "OR>")
     )
   )
 )
 (if (and eset (> (sslength eset) 0))
   (progn
     (setq cnt(sslength eset))
     (command "ERASE" eset "")
     (alert (strcat "Erased " (itoa cnt) " Entities."))  
   )
 )
 (setvar "cmdecho" 1)
 (princ)
)
(princ "\n Type test2.")
(princ "\nttray33y CADTutor.")

 

for deleting objects from nested blocks, see link below

 

http://www.cadtutor.net/forum/showthread.php?69075-Delete-entity-in-nested-block

Edited by ttray33y
Link to comment
Share on other sites

try this bro, however it does not delete nested object inside blocks.

(defun c:test2(/ cntr eset en cnt)
 (setvar "cmdecho" 0)
 (setq eset
   (ssget"X" 
     (list 
       (cons -4 "<OR")
         (cons 0 "ARC")
         (cons 0 "ATTRIBUTE")
         (cons 0 "CIRCLE")
         (cons 0 "ELLIPSE")
         ;(cons 0 "INSERT")
         (cons 0 "LINE")
         (cons 0 "LWPOLYLINE")
         (cons 0 "MLINE")
         (cons 0 "MTEXT")
         (cons 0 "POINT")
         (cons 0 "POLYLINE")
         (cons 0 "SOLID")
         (cons 0 "TEXT")
         (cons 0 "TRACE")
         (cons 0 "XLINE")
   (cons 0 "LEADER")
   (cons 0 "HATCH")
       (cons -4 "OR>")
     )
   )
 )
 (if (and eset (> (sslength eset) 0))
   (progn
     (setq cnt(sslength eset))
     (command "ERASE" eset "")
     (alert (strcat "Erased " (itoa cnt) " Entities."))  
   )
 )
 (setvar "cmdecho" 1)
 (princ)
)
(princ "\n Type test2.")
(princ "\nttray33y CADTutor.")

 

for deleting objects from nested blocks, see link below

 

http://www.cadtutor.net/forum/showthread.php?69075-Delete-entity-in-nested-block

 

Thanks again for the effort. I truely require one that does in deep nested levels since the drawings i encounter has many block within blocks

Link to comment
Share on other sites

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...