Jump to content
svorgodne

Avoid checked box on insert block

Recommended Posts

svorgodne

Hello everyone,

 

Is there any way to script something in Lisp to avoid the "Explode" check box on the insertion command?

 

My first guess was there would be probably asystem variable that controls that but couldn't find it.

 

Any suggestions? Clues?

 

thanks in advance

 

BlockExploded.JPG.89cd7c5392abc9adc28417b1e5de7433.JPG

 

Share this post


Link to post
Share on other sites
Tharwat

Hi,

I have noticed is that this Explode option in AutoCAD 2017 ( this version is what I am currently using ) is related to the block definition itself, so if you checked the option of Allow Exploding at the creation of the block then that Explode check box would be available to the user to toggle otherwise users won't able to activate it at all from the INSERT command unless they have the block definition redefined with allow exploding.

 

Its just an info for all whom did not already knew this. :) 

Share this post


Link to post
Share on other sites
rlx
5 minutes ago, Tharwat said:

Hi,

I have noticed is that this Explode option in AutoCAD 2017 ( this version is what I am currently using ) is related to the block definition itself, so if you checked the option of Allow Exploding at the creation of the block then that Explode check box would be available to the user to toggle otherwise users won't able to activate it at all from the INSERT command unless they have the block definition redefined with allow exploding.

 

Its just an info for all whom did not already knew this. :) 

 

This was somewhere in the back of my mind (way way back) but don't think I ever created blocks with the explicit option of not allowed to explode. Mostly because  I hate to have or  to put restrictions on people. But maybe its not a bad idea for some people to protect them against themselves 😉 Thanx for the info bro 🙂

  • Thanks 1

Share this post


Link to post
Share on other sites
ronjonp

You could use this to make all your blocks unexplodable <- word? :)

(vlax-for a (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
  (and (= 0 (vlax-get a 'islayout)) (vla-put-explodable a :vlax-false))
)

 

Edited by ronjonp
me fix grammar

Share this post


Link to post
Share on other sites
svorgodne

Thanx to everyone, I found the problem. I made a lisp routine to setup different UCS which are loaded from different drawings which are inserted as exploded objects.

    "-insert"
    "*Path\\Drawing.dwg"
    "0,0"

For some reason, and since this is loaded from the very beginning, every time a drawing is loaded, then some variable remains like that. I solved this adding the code @rlx was suggesting

 

(vl-registry-write 
  (strcat 
    "HKEY_CURRENT_USER\\" 
    (vlax-product-key)
    "\\Profiles\\"
    (getvar 'CPROFILE) 
    "\\Dialogs\\insert_dialog"
  )
  "Explode"
  0
)

at the end of the whole routine, so everything goes back to "normal".

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×