0 Members and 2 Guests are viewing this topic.
(defun DeletLays_ExplodeBlk (Doc LayList BlkList / cnt)(defun ExplodeList (ObjList BlkList / NewObjList)(foreach Obj ObjList (if (and (= (vla-get-ObjectName Obj) "AcDbBlockReference") (vl-position T (mapcar '(lambda (y) (wcmatch (strcase (vla-get-Name Obj)) (strcase y)) ) BlkList ) ) ) (if (vl-catch-all-error-p (setq NewObjList (vl-catch-all-apply 'vlax-invoke (list Obj "Explode"))) ) (setq cnt (1+ cnt)) (progn (vla-Delete Obj) (ExPlodeList NewObjList BlkList) ) ) ))(princ));------------------------------------------------------------------------------(setq cnt 0)(vlax-for Lo (vla-get-Layouts Doc) (vlax-for Obj (vla-get-Block Lo) (cond ((vl-position T (mapcar '(lambda (x) (wcmatch (strcase (vla-get-Layer Obj)) (strcase x))) LayList)) (vla-Delete Obj) ) ((and (= (vla-get-ObjectName Obj) "AcDbBlockReference") (vl-position T (mapcar '(lambda (y) (wcmatch (strcase (vla-get-Name oBJ)) (strcase y)) ) BlkList ) ) ) (if (vl-catch-all-error-p (setq NewObjList (vl-catch-all-apply 'vlax-invoke (list Obj "Explode"))) ) (setq cnt (1+ cnt)) (progn (vla-Delete Obj) (ExPlodeList NewObjList BlkList) ) ) ) ) ))(princ))
(defun c:tst (/ ss) (if (setq ss (ssget (list (cons 8 "A-ARE*,A-DIM*,A-NOT*,A-PAT*,A-SHT*,A-SYM*") (cons 2 "UT*")))) (progn (setvar "qaflags" 1) (command "_.explode" ss "") (setvar "qaflags" 0))))
(vlar-yourwelcome Gary)Not sure if it will work with ObjectDBX though
(defun exp_on_layer (layers / ss) (setvar "qaflags" 1) (if (setq ss (ssget "_all" (list (cons 8 layers)))) (vl-cmdf "_.explode" ss "") ) (setvar "qaflags" 0))(defun del_on_layer (layers / ss) (if (setq ss (ssget "_all" (list (cons 8 layers)))) (vl-cmdf "_.erase" ss "") ))(defun C:TEST () (exp_on_layer "0-XREF") (del_on_layer "A-ALT-WIND-2,A-ALT-WIND-3,A-ARE*,A-DIM*,A-NOT*,A-PAT*,A-SYM*,A-SHT*,DEF*,0-XREF,*NOTE"))
This works now. I tested it. Sorry about that.
TimWorks great now...you da man.Quote from: T.Willey on August 28, 2006, 05:37:38 PMThis works now. I tested it. Sorry about that.Thank you. I like this version over Alan's because it can be used by objectdbx.Anyway, I still have to fine tone it and add in the objectdbx code. Will post itwhen I get it all togeher.This routine is a big time saver.I can now put up my "easy" button and get back to work.Gary