CADkitt Posted September 14, 2010 Posted September 14, 2010 (edited) I want to overwrite a block and not insert it. I use this code: (command "_.-insert" "TEMPLATE=TEMPLATE" "y" nil) 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.... Edited September 15, 2010 by CADkitt added code tage Quote
BlackBox Posted September 14, 2010 Posted September 14, 2010 Edit: I want to overwrite a block and not insert it. 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! Quote
CADkitt Posted September 15, 2010 Author Posted September 15, 2010 *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 way tnx Quote
CADkitt Posted September 15, 2010 Author Posted September 15, 2010 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. Quote
dbroada Posted September 15, 2010 Posted September 15, 2010 I usually insert the block and then ERASE L Quote
CADkitt Posted September 15, 2010 Author Posted September 15, 2010 I knew there was such a cmd but didn't know how it was called. Gonna try it out tnx! Quote
alanjt Posted September 15, 2010 Posted September 15, 2010 (command "._-insert" "NAME=" nil) The equal will tell it to redefine an existing definition and cancel before block is actually inserted. Quote
alanjt Posted September 15, 2010 Posted September 15, 2010 isn't it "NAME=" ? Oops, you're correct. Not enough sleep. Quote
CADkitt Posted September 15, 2010 Author Posted September 15, 2010 (command "._-insert" "NAME=" nil) The equal will tell it to redefine an existing definition and cancel before block is actually inserted. Script-pro stops when you cancel a command. So I can't use nil. Quote
alanjt Posted September 15, 2010 Posted September 15, 2010 Script-pro stops when you cancel a command. So I can't use nil. What if you wrap it in a command and call the command? (defun _redef (/) (command "._-insert" "NAME=" nil)) (_rdef) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.