Exit Plot Preview

Discussion in 'AutoCAD' started by James Allen, Feb 17, 2005.

  1. James Allen

    James Allen Guest

    Is it possible with vba to make a preview command button work just like the
    built-in plot dialogue preview button? (e.g. switch focus to preview for
    user interaction, and on user exit return autocad to normal view state and
    focus back to modal form.) Here's the closest I've come.

    Code:
    'Modeless form with a preview button and a cancel button.
    Private Sub CommandButton1_Click()
    
    'Me.Hide
    'ThisDrawing.SendCommand "Preview" & vbCr
    ThisDrawing.Plot.DisplayPlotPreview acFullPreview
    'Me.Show
    
    End Sub
    
    Specifically, I've encountered two issues:
    1. I'd prefer a modal form, but if I use the preview Method in a modal form,
    the normal user exits don't seem to work (w2kp, a2k5). The only way to exit
    the preview is to minimize and restore the window. The preview Command
    seems to work with a modal form if I hide it first (which is what I want
    anyway), but that leads to issue two.
    2. I can't figure out how to show the form on user exit of the preview. Is
    there an event for this? Or some normal user input call I have missed? If
    I uncomment me.show, then it doesn't wait for the user to exit the preview.

    Any input welcome.
     
    James Allen, Feb 17, 2005
    #1
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.