sage12 发表于 2022-7-5 14:30:12

Explode the new array (rectang

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.

SLW210 发表于 2022-7-5 15:29:14

I have moved your thread to the AutoLISP, Visual LISP & DCL Forum.

rlx 发表于 2022-7-5 15:57:36

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)       
         
页: [1]
查看完整版本: Explode the new array (rectang