Jump to content

Recommended Posts

Posted

i found this bit of code which locates wipeouts within blocks and sends to back. Is it possible to be modified so that instead of sending to the back, it deletes them?

 

(defun c:t1 ( / ss1 )(if (setq ss1 (ssget "X" '((0 . 
"WIPEOUT"))))(command "_.draworder" ss1 "" "_Back")))

Posted

pretty sure that code above worked yesterday, doesn't seem to now though :?

actually i think this code below works a bit better. Its from Lee Macs dwgorder lisp (Thanks Lee!)

It locates wipeouts in blocks and sends to the back. If it could be modified to delete them instead of sending to back that would be great!

 

(defun c:BlockWipeouts2Bottom (/ blk item lst Sortents count)
 (setq count 0)
 (vlax-for blk (vla-get-Blocks (vla-get-ActiveDocument (vlax-get-acad-object)))
   (if (and (= (vla-get-IsLayout blk) :vlax-false)
            (= (vla-get-IsXRef blk) :vlax-false)
            (not (wcmatch (strcase (vla-get-Name blk)) "`**"))
       )
     (vlax-for item blk
       (if (eq (vla-get-ObjectName item) "AcDbWipeout")
         (setq lst (cons item lst) count (1+ count))
       )
     )
   )
   (if (and lst
            (setq Sortents
                   (LM:SortentsTable
                     (vla-ObjectIDtoObject
                       (vla-get-ActiveDocument
                         (vlax-get-acad-object)
                       )
                       (vla-get-OwnerID (car lst))
                     )
                   )
            )
       )
     (vla-MovetoBottom Sortents (LM:ObjectVariant lst))
   )
   (setq lst nil)
 )
 (vla-Regen (vla-get-ActiveDocument (vlax-get-acad-object)) acAllViewports)
 (princ "\n")
 (princ count)
 (princ " wipeouts moved to bottom inside blocks.")
 (princ)
)

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