Nil used in a list

Discussion in 'AutoCAD' started by BobBuilder, Aug 6, 2003.

  1. BobBuilder

    BobBuilder Guest

    Hi,

    am trying to create a lisp to insert a block to redefine an existing one, then to exit from the command without actually inserting the new block. then i want to close and save the drawing. I have no idea what i am doing but here is what i have so far:- ;BEGIN SCRIPT (command "-insert" "a0=" nil)
    (command "-insert" "a1=" nil)
    (command "-insert" "a2=" nil)
    (command "-insert" "a3=" nil)
    qsave
    ;END SCRIPT

    but when i run the script and it get to nil it totally stops the lisp file. any ideas?
     
    BobBuilder, Aug 6, 2003
    #1
  2. BobBuilder

    BillZ Guest

    Try using control C to instead of nil to exit the insert command.
    (command "_.insert" (strcat blk (chr 61) fl2) ^c)
    See if that helps.

    Bill
     
    BillZ, Aug 6, 2003
    #2
  3. BobBuilder

    BobBuilder Guest

    does that same thing
     
    BobBuilder, Aug 6, 2003
    #3
  4. Perhaps the script will perform better if you

    (command "-insert" "a0=") (command)

    ?

    --

    -Jason
    Member of the Autodesk Discussion Forum Moderator Program


    inserting the new block. then i want to close and save the drawing. I have no idea what i am doing but here is what i have so
    far:- ;BEGIN SCRIPT (command "-insert" "a0=" nil)
     
    Jason Piercey, Aug 6, 2003
    #4
  5. BobBuilder

    Doug Broad Guest

    Any cancel in a script will stop the script.  Stop thinking like a



    drafter and more like a programmer.  Instead of cancelling,



    go ahead and insert it and then erase it.  The script will



    take almost no more time.  LISP is not required for such



    a simple task and just complicates things.



    "BobBuilder" <> wrote in message news:...

    Hi,

    am trying to create a lisp to insert a block to redefine an existing one, then to exit from the command without actually inserting the new block. then i want to close and save the drawing. I have no idea what i am doing but here is what i have so far:- ;BEGIN SCRIPT (command "-insert" "a0=" nil)
    (command "-insert" "a1=" nil)
    (command "-insert" "a2=" nil)
    (command "-insert" "a3=" nil)
    qsave
    ;END SCRIPT

    but when i run the script and it get to nil it totally stops the lisp file. any ideas?
     
    Doug Broad, Aug 6, 2003
    #5
  6. BobBuilder

    BobBuilder Guest

    Ok what do you recommend, i have hundreds of drawings to do?
     
    BobBuilder, Aug 6, 2003
    #6
  7. BobBuilder

    BobBuilder Guest

    also, how do i erase it when other blocks have the same name?
     
    BobBuilder, Aug 6, 2003
    #7
  8. BobBuilder

    Doug Broad Guest

    Insert blahblah= 0,0 1 1 0



    erase l



    insert blahblah2= 0,0 1 1 0



    ....



    "BobBuilder" <> wrote in message news:...

    Ok what do you recommend, i have hundreds of drawings to do?
     
    Doug Broad, Aug 6, 2003
    #8
  9. BobBuilder

    Doug Broad Guest

    Make that



    erase (entlast)



     



    Using "L" will only catch



    those objects on the screen.



     



    Either that or zoom and use an insertion point



    that you know will be on the screen of each drawing.



    "Doug Broad" <> wrote in message news:...



    Insert blahblah= 0,0 1 1 0



    erase l



    insert blahblah2= 0,0 1 1 0



    ....



    "BobBuilder" <> wrote in message news:...

    Ok what do you recommend, i have hundreds of drawings to do?
     
    Doug Broad, Aug 6, 2003
    #9
  10. BobBuilder

    PF Guest

    Or... (if and only if a part of the block appears @ viewctr <center of
    screen>)

    Insert blahblah= (getvar"viewctr") 1 1 0
    erase l

    - Doug's method will find the block in the Database - instead of the
    Display!
    Use his...(it's better)... but knowing this variation will help you grasp
    Why his works one way, and this another.
     
    PF, Aug 7, 2003
    #10
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.