asapella Posted June 16, 2016 Posted June 16, 2016 Hi everyone glad to be in this amazing forum. Straight to the point: is there a way to explode the nested blocks in a drawing that contain a a common word in their name? In our case we have a lot of blocks exported from vectorworks whose name was substitute with -group-xxx-y, is there a way to run a routine similar to exnest but that would explode only the nested blocks with that similar name? Thanks for any help:) Quote
asapella Posted June 16, 2016 Author Posted June 16, 2016 Thanks samifox the exnest works fine but it explodes all the nested block. The intention is to explode only the nested blocks that have the same partial name -group- while preserving the nested blocks named differently. Quote
pkenewell Posted June 16, 2016 Posted June 16, 2016 Modify Lee's Code in the following way: ;; by Lee Mac; 4th Sep 2012 at 08:00 am. (defun c:exnest ( ) (vlax-for blk (vla-get-blocks (LM:acdoc)) (if (and (= :vlax-false (vla-get-isxref blk)) (= :vlax-false (vla-get-islayout blk)) ) (vlax-for obj blk (if (and (= "AcDbBlockReference" (vla-get-objectname obj)) ;;================== [color=red](wcmatch (vla-get-name obj) "*GROUP*")[/color] ;; Add This Line Here ;;================ (null (vl-catch-all-error-p (vl-catch-all-apply 'vla-explode (list obj)))) ) (vl-catch-all-apply 'vla-delete (list obj)) ) ) ) ) (command "_.-purge" "_B" "*" "_N") (vla-regen (LM:acdoc) acallviewports) (princ) ) ;; Active Document - Lee Mac ;; Returns the VLA Active Document Object (defun LM:acdoc nil (eval (list 'defun 'LM:acdoc 'nil (vla-get-activedocument (vlax-get-acad-object)))) (LM:acdoc) ) Quote
asapella Posted June 17, 2016 Author Posted June 17, 2016 Thank you very much pkenewell, you are the best. That was it. It meant the world not to have to go through all the freaking blocks. Peace and respect to all the pro sharing their great knowledge on this forum:excited: 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.