Preselecting a dialog box tab

Discussion in 'AutoCAD' started by Allen Johnson, Jun 1, 2004.

  1. Is there a way in VBA to preslect a dialog tab in a dialog box, similar to
    the menu method

    [&Osnap Settings...]'_+dsettings 2
     
    Allen Johnson, Jun 1, 2004
    #1
  2. Allen Johnson

    Jürg Menzi Guest

    Allen

    Try this:
    ThisDrawing.SendCommand "_+dsettings" & vbCrLf & "2"

    Cheers
     
    Jürg Menzi, Jun 1, 2004
    #2
  3. I was actually wanting to select the third tab of the UCS dialog.
    I had tried this and it didn't work:

    ThisDrawing.SendCommand "dducs "
    SendKeys "+{TAB}{LEFT}{LEFT}"

    I then tried your suggestion but it doesn't recognise the command +DDUCS
     
    Allen Johnson, Jun 1, 2004
    #3
  4. Allen Johnson

    Jürg Menzi Guest

    Hi Allen

    Unfortunately not all dialogs with registers have this feature. Once
    opened, you've no possibility to use 'SendKeys'...8-(

    Cheers
     
    Jürg Menzi, Jun 2, 2004
    #4
  5. Yeah, that's what I figured (but was still hoping someone might have a way).
    Oh, well.

    Thanks
     
    Allen Johnson, Jun 2, 2004
    #5
  6. Allen Johnson

    wivory Guest

    I might have good news for you Allen. Sometimes you can successfully send keystrokes to a dialog box by sending them *before* you activate the dialog.

    I notice your example went LEFT on the tabs. I'm not sure if you have a different dialog than me but if I want to get to the Settings tab I have to go RIGHT. The following worked for me:
    [pre]
    AppActivate "AutoCAD 2002"
    SendKeys "+{TAB}{RIGHT}{RIGHT}"
    ThisDrawing.SendCommand "dducs" & vbCr
    [/pre]
    Regards

    Wayne Ivory
    IT Analyst Programmer
    Wespine Industries Pty Ltd
     
    wivory, Jun 3, 2004
    #6
  7. Allen Johnson

    Jürg Menzi Guest

    Hi Wayne

    I didn't recognize this possibility, thanks for the information.
    BTW I'm working with this sequence:

    SendKeys "^{TAB}^{TAB}"
    ThisDrawing.SendCommand "_DDUCS" & vbCr

    Cheers
     
    Jürg Menzi, Jun 3, 2004
    #7
  8. Thanks! That works!
     
    Allen Johnson, Jun 4, 2004
    #8
  9. I could never tell my right hand from my left!
     
    Allen Johnson, Jun 4, 2004
    #9
  10. Allen Johnson

    wivory Guest

    It's the one on the right.

    BWAAAAHAHA!!

    (Excuse me.) Glad the solution worked. ;-)

    Wayne
     
    wivory, Jun 8, 2004
    #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.