CADkitt 发表于 2022-7-6 10:28:23

cancel insert doesn't wor

I want to overwrite a block and not insert it. I use this code:

I have one lisp running just fine but now I want to use it for another lisp and it hangs on pick a point :@
And I have no idea why it does that....

BlackBox 发表于 2022-7-6 10:37:54

Edit:
 
 
Technically, you are inserting the block. Your result is that the block definition within your drawing is 'overwritten' as a result of the "=" in the block name declaration.
 
Experiment with the pause function, to manually specify the insertion point:
 

(command "._-insert" "TEMPLATE=TEMPLATE" pause)
 
 
If you simply want all blocks to be 'overwritten', then this may be what you want:
 

(command "._-insert" "TEMPLATE=TEMPLATE" nil)
 
 
Hope this helps!

CADkitt 发表于 2022-7-6 10:43:08

*sigh the "y" screwed things up it wasn't needed, I thought you needed to confirm overwriting?(In another script of mine the "y" works just fine)
@renderman You didn't get me exact right but helped any waytnx

CADkitt 发表于 2022-7-6 10:48:48

pffff the real problem was I was using script-pro and because I cancel the insert cmd script-pro thought hmm something got canceled lets just stop working...
I now used doc.lsp, could also insert the block and then delete it.

dbroada 发表于 2022-7-6 10:57:55

I usually insert the block and then ERASE L

CADkitt 发表于 2022-7-6 11:02:15

I knew there was such a cmd but didn't know how it was called. Gonna try it out tnx!

alanjt 发表于 2022-7-6 11:08:25

(command "._-insert" "NAME=" nil)The equal will tell it to redefine an existing definition and cancel before block is actually inserted.

dbroada 发表于 2022-7-6 11:13:47

isn't it "NAME=" ?

alanjt 发表于 2022-7-6 11:17:25

Oops, you're correct. Not enough sleep.

CADkitt 发表于 2022-7-6 11:24:49

Script-pro stops when you cancel a command. So I can't use nil.
页: [1] 2
查看完整版本: cancel insert doesn't wor