Explode dynamic block

 Can we explode by any way imported dynamic block , please?

Comments

  • To make a 'normal' block explodable all you have to do is check the appropriate option in the _EXPBLOCKS list. This does not work for modified inserts of dynamic blocks. These have anonymous definitions (names starting with "*") that do not appear in the list.

    Here is some Lisp code to fix this:
    [code](defun KGA_Data_XdataGet (ename app)
      (cdadr (assoc -3 (entget ename (list app))))
    )

    (defun c:MakeBlockExplodable ( / doc nmLst ss)
      (setq doc (vla-get-activedocument (vlax-get-acad-object)))
      (vla-endundomark doc) ; End open undo group.
      (vla-startundomark doc)
      (if (setq ss (ssget '((0 . "INSERT"))))
        (progn
          (mapcar
            '(lambda (enm / nm)
              (setq nm (strcase (vla-get-effectivename (vlax-ename->vla-object enm))))
              (if (not (vl-position nm nmLst)) (setq nmLst (cons nm nmLst)))
            )
            (vle-selectionset->list ss)
          )
          (mapcar
            '(lambda (blk / hnd)
              (cond
                ((= :vlax-true (vla-get-islayout blk))
                  nil
                )
                ((= :vlax-true (vla-get-isxref blk))
                  nil
                )
                ((vl-position (strcase (vla-get-name blk)) nmLst)
                  (vla-put-explodable blk :vlax-true)
                )
                ((wcmatch (vla-get-name blk) "`**")
                  (if
                    (and
                      (setq hnd (cdr (assoc 1005 (KGA_Data_XdataGet (vlax-vla-object->ename blk) "AcDbBlockRepBTag"))))
                      (vl-position (strcase (vla-get-name (vla-handletoobject doc hnd))) nmLst)
                    )
                    (vla-put-explodable blk :vlax-true)
                  )
                )
              )
            )
            (vle-collection->list (vla-get-blocks doc))
          )
        )
      )
      (vla-endundomark doc)
      (princ)
    )[/code]
  • Roy omitted mentioning something that you may not be aware of.

    In my v14, I have no problems exploding dynamic blocks.  But, blocks can be created with a setting that forbids exploding them.  If you attempt to explode one of those types, there is not error message or anything on the command line to indicate that block does not permit exploding in my version 14.  It simply does not explode.

    I just learned from Roy's post, that it is possible to un-protect those blocks.  Though you can't use this approach for anonymous blocks, which happen to have that "don't explode" setting.  I am puzzled why this option called "Explodable" is ghosted when you look at the properties for a single block, but made available in the block explorer.

    -Joe
  • To clarify:
    1.
    The explodability of dynamic block is determined by the author.
    2.
    The explodability is a property of the block definition, not of the block reference (=insert).
  •  While not directly related to the subject, we discussed the issue of blocks that are set to not be explodable.

    While playing with the topic, I created a block that I set to be unexplodable, and forgot about it.  Then, I unintentionally created some unexplodable blocks in my drawing.

    I needed to explode them. Then, I remembered that I could use refedit to edit the blocks. And moreover, I had recently copied a portion of one of them, and then removed them from the block.  So, I tried that with one of my unexploable block, copying all of the objects.  Then I redefined the block, making sure the explodable check box was selected.  It worked!  You can change a block from unexplodable, to explodable, using this method.

    -Joe
This discussion has been closed.