masterfal Posted July 15, 2016 Posted July 15, 2016 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"))) Quote
masterfal Posted July 15, 2016 Author Posted July 15, 2016 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) ) Quote
Recommended Posts
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.