Redefining a block in a script

Discussion in 'AutoCAD' started by Cadillac Joe, Jun 22, 2004.

  1. Cadillac Joe

    Cadillac Joe Guest

    Is there a way to use the insert command in a script routine to redefine an existing block definition? The problem I am having is that while running the script, AutoCAD asks for an insertion point for the block. Without the script, when I redefine a block and am prompted for the insertion point, I usually hit ESC, which cancels the command, but the block is redefined anyway. In the script, I've tried using ^C^C, which I believe means cancel, but AutoCAD doesn't recognize it.

    Am I doing something wrong, or is there another way this can be done?
     
    Cadillac Joe, Jun 22, 2004
    #1
  2. Cadillac Joe

    ECCAD Guest

    Try:
    (command "-insert =" "path/path/blockname" ip "" "" "")
    I think that's where the "=" sign goes..
    Bob
     
    ECCAD, Jun 22, 2004
    #2
  3. Cadillac Joe

    Cadillac Joe Guest

    Bob,

    I tried that, but still can't get it to work right. Here's the string I'm using:

    (command "-insert ="KTA_DETAIL" "I:\BLOCKS\KTA_DETAIL" ip "" "" "")

    After I run the string, AutoCAD prompts with ("_>

    What am I doing wrong?

    is that correct?
     
    Cadillac Joe, Jun 22, 2004
    #3
  4. Cadillac Joe

    ECCAD Guest

    Change:
    (command "-insert ="KTA_DETAIL" "I:\BLOCKS\KTA_DETAIL" ip "" "" "")
    to:
    (command "-insert =" "KTA_DETAIL" "I:\BLOCKS\KTA_DETAIL" ip "" "" "")

    Added another " next to blockname.

    Bob
     
    ECCAD, Jun 22, 2004
    #4
  5. Cadillac Joe

    ECCAD Guest

    Or maybe:
    (command "-insert =" "I:\BLOCKS\KTA_DETAIL" ip "" "" "")
    It will pick up the blockname from the end..
    Bob
     
    ECCAD, Jun 22, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.