Forcing an escape

Discussion in 'AutoCAD' started by Darrell, Oct 8, 2004.

  1. Darrell

    Darrell Guest

    I have an app that creates a form within AutoCAD. What is happening is that
    some users are clicking on some buttons on the form while a command is still
    active in AutoCAD (i.e Pan) and they're getting an error message. I want to
    be able to have my buttons perform an 'Escape' to cancel any active AutoCAD
    commands before performing the functions of the button. I've tried sending
    different commands but to no avail.

    This is for ACAD2K throught to ACAD2K5. I have written my app in Delphi but
    that souldn't matter.

    TIA
     
    Darrell, Oct 8, 2004
    #1
  2. Darrell

    AKS Guest

    Yes, in addition to allowing a command null it would be nice to be able to return the current active command name and to also intercept the user activities as they occur prior to allowing the activities to pass on to the commands. The other CAD application works that way.
     
    AKS, Oct 14, 2004
    #2
  3. Darrell

    lorier Guest

    have you tried sending "^c^c"
     
    lorier, Oct 20, 2004
    #3
  4. Darrell

    Darrell Guest

    Yes.
     
    Darrell, Oct 22, 2004
    #4
  5. Darrell

    thenov Guest

    Try Using this: SendKeys "{ESC}" & "{ESC}"
     
    thenov, Oct 23, 2004
    #5
  6. Darrell

    Darrell Guest

    Ive tried sending everything I can think of. It doesn't seem to be what is
    sent as being the problem. It's a matter of the fact that ACAD will not
    allow you to interupt it. I continually get a 'Call was rejected by Callee'
    error. As I mentioned in my original post, I am using Delphi 7 to develop
    with. Maybe this does make a difference because it seems like ACAD will not
    allow a SendCommand to be passed while it is currently in the middle of
    something i.e. Pan
     
    Darrell, Oct 25, 2004
    #6
  7. Darrell

    AKS Guest

    I've also tried all these from within an Acad VBA. Nothing appears to happen. The commands seem to be ingnored and they are not stored to be executed after the VBA closes out.
     
    AKS, Oct 26, 2004
    #7
  8. Darrell

    Mikko Guest

    Remember to set focus to AutoCAD before using SendKeys

    AppActivate(ACADApp.Caption)
    SendKeys.Send(Chr(27) + Chr(27))
    AppActivate("YourApplication")
     
    Mikko, Oct 29, 2004
    #8
  9. Darrell

    Darrell Guest

    Unfortunately, SendKeys is not available with Delphi.
     
    Darrell, Nov 2, 2004
    #9
  10. Darrell - Can you tell me if your form is running in a
    standalone .EXE or in an ActiveX DLL that's running
    in AutoCAD's process?

    That's the first question. Solving your problem is quite
    easy, but I need to know a bit more.
     
    Tony Tanzillo, Nov 2, 2004
    #10
  11. Tony, I am having the same problem
    with some of my buttons on a vba v02 form
    which fires code with only vba methods
    ...no sendcommand.

    Command line needs to be cleared out similar
    to hitting esc key before the code will run. I have
    trapped in error check, but would rather solve
    when user clicks the button and before code is
    excuted.

    Thanks
    Paul
     
    Paul Richardson, Nov 4, 2004
    #11
  12. Sorry to jump in the middle btw...

    I think I have isolated the error
    to >.Application.Update...

    If command line needs to be
    cleared I get the error. Strange
    part is if I go into the debug it
    lets me step thru the application
    update without error...

    Thanks...
     
    Paul Richardson, Nov 4, 2004
    #12
  13. Darrell

    Darrell Guest

    My form is running in a stand alone .EXE


     
    Darrell, Nov 5, 2004
    #13
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.