Jump to content

cancel insert doesn't work always...


Recommended Posts

Posted (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 by CADkitt
added code tage
Posted

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!

Posted

*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

Posted

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.

Posted

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

Posted
(command "._-insert" "NAME=" nil)

The equal will tell it to redefine an existing definition and cancel before block is actually inserted.

Posted
isn't it "NAME=" ?

Oops, you're correct. Not enough sleep.

Posted
(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.

Posted
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)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...