I have used Lisp and the insert command to do *blockname to explode the insertion of a block. this sets the explode check mark on the insert dialog. Once I set it on the next insert an explode occurs. I do not find away to turn it off. Is there some trick to use that will uncheck the explode box. I don't seem to find any system variable. I thought of inserting a dummy block without the asterisk. I thought about trying to do a cancel somehow on insert. Anyone got a trick they might have used?
Jim
@Anonymous wrote:I have used Lisp and the insert command to do *blockname to explode the insertion of a block. this sets the explode check mark on the insert dialog. Once I set it on the next insert an explode occurs. I do not find away to turn it off. Is there some trick to use that will uncheck the explode box. I don't seem to find any system variable. ....
Yes, there's a System Variable for that. If the Explode check-box is on, this will turn it off for you, keeping the same Block name:
(if (= (substr (getvar 'insname) 1 1) "*")
(setvar 'insname (substr (getvar 'insname) 2))
)
@Kent1Cooper wrote:....
(if (= (substr (getvar 'insname) 1 1) "*")
(setvar 'insname (substr (getvar 'insname) 2))
)
Or, if you don't feel a need to retain the same default Block name, simply:
(setvar 'insname "")
That will leave you with the Explode box in the dialog box un-checked, and the default offered will just be the first Block in the list, as when you first open a drawing.
Kent,
I appreciate your response. I first tried the technic of pulling the * off the front of the insname variable. I found however that the blocks I'm inserting are on a network path and the variable doesn't like more than a block name. I tried to use just a dummy block name without a change in the check. Your second message came and I just tired plugging that in to clear the insname. It clears the insname okay but when I do an insert just after that the * is still checked.
We are missing something here yet.
Jim
@Anonymous wrote:.... Your second message came and I just tired plugging that in to clear the insname. It clears the insname okay but when I do an insert just after that the * is still checked.
....
Hmmm.... I now find that (setvar 'insname "") sometimes unchecks the Explode check-box in the Insert dialog box [I did try it before suggesting it earlier, and it worked then, and again the first time just now], but not always. If I can figure out what makes the difference, maybe it will suggest a solution, but I'm kinda stumped.
EDIT: And to make matters worse, I now find that, if the Insert dialog box has Explode checked, and I use the non-dialog-box -INSERT command to put in a Block non-exploded, that Block's name becomes the default, but the Explode check-box remains checked!
To uncheck the 'Explode' toggle on the Insert dialog:
(vl-registry-write (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\Profiles\\" (getvar 'CPROFILE) "\\Dialogs\\insert_dialog") "Explode" 0 )
However, this will require an AutoCAD restart to see the change.
Lee,
Thank you also. I was able to run and reopen the drawing to find it was reset off. There is a concern however. The user must know he has to restart AutoCAD. It would be just as easy for user to insert another block and uncheck the box complete the insert and erase the block. I was hoping that one could switch off without the user interaction and having to remember to do it before inserting another block.
I was hoping someone had a magic idea like: Do the insert but have some way to uncheck the box, then cancel the insert after it was set off. The box has it's own magic and is in the registry it appears.
If I created a dummy block and insert without the explode. Then do something like and erase previous and purge it.
Jim
As you have correctly ascertained from my post, the setting is indeed stored in the registry, however, AutoCAD only reads the registry on startup, then modifies the registry when the user changes various settings to be stored and read upon the next restart.
I can't presently see any other way to alter the Explode setting without doing it manually through the Insert dialog.
I think a combination of the registry write and setting insname to "" will do the trick? no?
Thank all for suggestions. I ended up changing my process so that it used the "explode" "last". Doing this avoided setting the insert command to explde and then finding away to reset insert explode.
More than one way to skin a cat.....thanks again.
Jim
Can't find what you're looking for? Ask the community or share your knowledge.