cancel/escape command in script

Discussion in 'AutoCAD' started by cadman009, Jul 22, 2004.

  1. cadman009

    cadman009 Guest

    how do i cancel a command within a script? i thought ^c used to work, but it's not working. i'm trying to run the rtext command and then cancel out of it as a part of a startup routine i've written.

    cm
     
    cadman009, Jul 22, 2004
    #1
  2. cadman009

    Tom Smith Guest

    Try using (command). Exactly what command sequence do you want & where ae
    you cancelling it?
     
    Tom Smith, Jul 22, 2004
    #2
  3. cadman009

    cadman009 Guest

    that won't work in this case. rtext is a lisp command, so if i try to use (command) to cancel it i get an error that says, "can't re-enter autolisp". isn't there a simple way to do a "cancel" for a command in a script? the way i tried it in a .scr is:

    (c:rtext)^c
    regenall

    i also tried it with a lisp routine:

    (c:rtext)
    (command)
    (command "regenall")

    but neither of the above are working. i want this to automatically run the rtext command and then cancel out of it when i open a drawing. we do a plot stamp with rtext on our drawing border, and it doesn't display unless after the first time you run the rtext command. i don't always remember to type in rtext before i plot and the rtext displays as a blank box on the plot.
     
    cadman009, Jul 22, 2004
    #3
  4. Use this instead to load RText:

    (if (not (member "rtext.arx" (arx))) (arxload "RText"))

    That way no cancel is required.

    --
    R. Robert Bell


    that won't work in this case. rtext is a lisp command, so if i try to use
    (command) to cancel it i get an error that says, "can't re-enter autolisp".
    isn't there a simple way to do a "cancel" for a command in a script? the
    way i tried it in a .scr is:

    (c:rtext)^c
    regenall

    i also tried it with a lisp routine:

    (c:rtext)
    (command)
    (command "regenall")

    but neither of the above are working. i want this to automatically run the
    rtext command and then cancel out of it when i open a drawing. we do a plot
    stamp with rtext on our drawing border, and it doesn't display unless after
    the first time you run the rtext command. i don't always remember to type
    in rtext before i plot and the rtext displays as a blank box on the plot.
     
    R. Robert Bell, Jul 22, 2004
    #4
  5. cadman009

    Tom Smith Guest

    I think you'll need to do this in a different way. AFAIK you can't send
    responses to a lisp function like you can to the command function, therefore
    you can't send it a cancel either. Maybe you could hack the rtext.lsp, or
    figure out which of its functions causes the rtext to display and just run
    that.

    I still don't understand the scripting approach. If it's something you want
    done on opening a drawing, I'd put it in a startup lisp. Or if it's only a
    plotting issue, I'd redefine the plot command to include this step.

    Sorry I can't provide any insight on the rtext display issue.
     
    Tom Smith, Jul 22, 2004
    #5
  6. cadman009

    David Bethel Guest

    It used to be the backspace key would pause / cancel a script. Maybe
    that has changed over the years. _David
     
    David Bethel, Jul 22, 2004
    #6
  7. cadman009

    cadman009 Guest

    hey, i tried that and it looks like it's working. thanks!
     
    cadman009, Jul 23, 2004
    #7
  8. cadman009

    cadman009 Guest

    thanks for the help i added the lines loading the rtext function to my startup lisp routine and it looks like it's working. i was just trying the script because i couldn't get it to work with straight lisp the way i was trying to do it. of course, it didn't work in the script either!
     
    cadman009, Jul 23, 2004
    #8
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.