Jump to content

Exploding dynamic blocks


Jessica28

Recommended Posts

I'm running autocad Mep 2016. I received a drawing with a ton of dynamic blocks. I'm trying to explode them all but can't. I see that you can go to the block editor and check "allow exploding" and redefine the block, but there are a TON of blocks and just as many drawings I'd have to do it to..Plus I tried it in one drawing and it did not seem to work on every block....Is there an easier and faster way to explode everything?

 

 

Thanks, Jess

Link to comment
Share on other sites

Hmmm. that just brought me to some home page and not to a specific post showing the Routine.....Maybe its because i'm not a member of that site? Is there another way you can get me the routine? I so want to try it..These drawings are making me crazy.

Link to comment
Share on other sites

from a member called MP

 

 

(defun c:UnDynamic

   (   /
       _get_item
       _right
       _make_key
       _dynamic->static_block
       _get_locked
       _get_dynamic_inserts
       _main
   )

   (defun _get_item ( collection key / item )
       (vl-catch-all-apply
          '(lambda ( ) (setq item (vla-item collection key)))
       )
       item
   )

   (defun _right ( str n / len )
       (if (< n (setq len (strlen str)))
           (substr str (1+ (- len n)))
           str
       )
   )

   (defun _make_key ( collection prefix len / key )
       (   (lambda ( i pad )
               (while
                   (_get_item collection
                       (setq key
                           (strcat prefix
                               (_right
                                   (strcat pad (itoa (setq i (1+ i))))
                                   len
                               )
                           )
                       )
                   )
               )
               key
           )
           0
           (   (lambda ( pad )
                   (while (< (strlen pad) len)
                       (setq pad (strcat "0" pad))
                   )
                   pad
               )
               ""
           )
       )
   )

   (defun _dynamic->static_block ( blocks insert len )
       (vla-ConvertToStaticBlock
           insert
           (_make_key blocks "STATIC_" len)
       )
   )

   (defun _get_locked ( layers / locked )
       (vlax-for layer layers
           (if (eq :vlax-true (vla-get-lock layer))
               (setq locked (cons layer locked))
           )
       )
       locked
   )

   (defun _get_dynamic_inserts ( blocks / inserts )
       (vlax-for block blocks
           (vlax-for object block
               (if (eq "AcDbBlockReference" (vla-get-objectname object))
                   (if (eq :vlax-true (vla-get-isdynamicblock object))
                       (setq inserts (cons object inserts))
                   )
               )
           )
       )
       inserts
   )

   (defun _main ( document / blocks inserts locked len )
       (if
           (setq inserts
               (_get_dynamic_inserts
                   (setq blocks (vla-get-blocks document))
               )
           )
           (progn
               (foreach layer (setq locked (_get_locked (vla-get-layers document)))
                   (vla-put-lock layer :vlax-false)
               )
               (setq len (strlen (itoa (length inserts))))
               (foreach insert inserts
                   (_dynamic->static_block blocks insert len)
               )
               (foreach layer locked
                   (vla-put-lock layer :vlax-true)
               )
           )
       )
       (princ)
   )

   (_main (vla-get-activedocument (vlax-get-acad-object)))

)

Link to comment
Share on other sites

hmmm. it helped....But they still wont explode or burst after I ran that command...I can copy and paste most stuff to other drawings where before nothing would copy and paste...But now all the devices will paste but the text wont come over....Weird.

Link to comment
Share on other sites

Ummmmm tzframpton. I'm not sure. By now I should probably know the difference but I guess I don't. How do I tell?.....I know when I click on one of their grips It brings up a list of content I can change it to....on another grip I can move it around and host it to other walls.....These are mainly electrical symbols...

Link to comment
Share on other sites

When you select the block it should give you a description at the top of the Properties palette. Can you report back to us what it says, just to eliminate the possibility it may be an AEC Object?

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...