sage12 Posted August 20, 2018 Share Posted August 20, 2018 Is there a way to globally explode all the arrays (rectangular) in my design. Some of the arrays are buried in nested blocks. I didn't know if anyone has a lsp routine that could do this. All the hidden blocks that the array command makes is not working well with our conversion programs. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted August 20, 2018 Share Posted August 20, 2018 I have moved your thread to the AutoLISP, Visual LISP & DCL Forum. Quote Link to comment Share on other sites More sharing options...
rlx Posted August 20, 2018 Share Posted August 20, 2018 https://www.cadtutor.net/forum/topic/56586-explode-the-new-array-rectangular-objects/ ;; Explode all 'New Type' Arrays - Lee Mac(defun c:exarrays ( / doc enx ) (vlax-for blk (vla-get-blocks (setq doc (vla-get-activedocument (vlax-get-acad-object)))) (if (= :vlax-false (vla-get-isxref blk)) (vlax-for obj blk (if (and (= "AcDbBlockReference" (vla-get-objectname obj)) (setq enx (entget (vlax-vla-object->ename obj))) (setq enx (cdr (assoc 330 (member '(102 . "{ACAD_REACTORS") enx)))) (= "ACDBASSOCDEPENDENCY" (cdr (assoc 0 (entget enx)))) ) (explode obj) ) ) ) ) (vla-regen doc acallviewports) (princ))(defun explode ( obj / lst ) (if (and (= "AcDbBlockReference" (vla-get-objectname obj)) (wcmatch (vla-get-effectivename obj) "`*U*") (vlax-write-enabled-p obj) ) (if (not (vl-catch-all-error-p (setq lst (vl-catch-all-apply 'vlax-invoke (list obj 'explode)) ) ) ) (progn (vla-delete obj) (foreach obj lst (explode obj)) ) ) ))(vl-load-com) (princ) Quote Link to comment Share on other sites More sharing options...
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.