Press ENTER when acad window appears

Discussion in 'AutoCAD' started by gizmowiebe, Dec 21, 2004.

  1. gizmowiebe

    gizmowiebe Guest

    Hi there,

    I'm creating a block manager for home use. And i'm using mslides because they look better than the thumbnails. When a button is pushed a drawing will open set to top view and zoom extends and then I'm trying to use the sendcommand option. But when the save as window appears it doesn't enter.

    This is my code

    **************************************************************
    Private Sub mslide_Click()

    Dim strSearchDoc As String
    Dim objDoc As AcadDocument

    strSearchDoc = pathfolder & "\" & ListBox1.Value & "\" & ListBox2.Value & ".dwg"

    For Each objDoc In ThisDrawing.Application.Documents
    If UCase(strSearchDoc) = UCase(objDoc.path & "\" & objDoc.name) Then
    Else
    AcadApplication.Documents.Open (pathfolder & "\" & ListBox1.Value & "\" & ListBox2.Value & ".dwg")

    End If
    Next

    Dim NewDirection(0 To 2) As Double
    NewDirection(0) = -0: NewDirection(1) = 0: NewDirection(2) = 1
    ThisDrawing.ActiveViewport.Direction = NewDirection
    ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
    Dim zoom As AcadDocument
    ZoomExtents

    Me.hide
    ThisDrawing.SendCommand "Mslide" & vbCr & vbCr

    End Sub

    ***************************************

    the last vbCr doesnt work.

    Anyone any ideas.

    THX

    Wiebe
     
    gizmowiebe, Dec 21, 2004
    #1
  2. This does what you want, but it may still stop on the dialog box if you hit
    the ENTER key after you start your macro.


    Me.hide
    SendKeys "{ENTER}"
    ThisDrawing.SendCommand "Mslide" & vbCr
    End Sub
     
    James Belshan, Dec 21, 2004
    #2
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.