Alow exploding in a block defunition via lisp function

Alow exploding in a block defunition via lisp function

Anonymous
Not applicable
1,057 Views
3 Replies
Message 1 of 4

Alow exploding in a block defunition via lisp function

Anonymous
Not applicable

Here described how to make a block unexplodable manualy:

 

"When a Block is created there are several options that sometimes are overlooked. One of this is the option to not allow the block to be exploded. If you don’t know that this exists, you might find yourself unable to explode a block that you really, really, really need to explode The trick is to open the block definition dialog box (type “b”, or “block”) without selecting anything. Then on the drop down list search for the block you are unable to explode. You will see that the “allow exploding” option is unselected. Select it and click OK. Now select the Block, enter X for EXPLODE. The Block should explode. "

 

Can you know how to do it via lisp function?

 

Thank you for your answers.

0 Likes
1,058 Views
3 Replies
Replies (3)
Message 2 of 4

gpcattaneo
Advocate
Advocate

Try this:

 

(defun c:test ( / b bN blk)
    (vl-load-com)
    (setq b (ssget  ":S:L" '((0 . "INSERT"))))
    (if b
        (progn 
            (setq bN 
                (vla-get-effectivename
                    (vlax-ename->vla-object (ssname b 0))
                )
            )
            (setq blk
                (vla-get-Blocks
                    (vla-get-activedocument
                        (vlax-get-acad-object)
                    )
                )
            )
            (vla-put-explodable (vla-Item blk bN) :vlax-true)
        )
    )
)

 

Message 3 of 4

Anonymous
Not applicable

This lisp working properly

Thank you

0 Likes
Message 4 of 4

Anonymous
Not applicable

If you want Disallow exploding  block  via lisp function just

replace

(vla-put-explodable (vla-Item blk bN) :vlax-true)

 to

(vla-put-explodable (vla-Item blk bN) :vlax-false)

 

0 Likes