vba form versus plot window

Discussion in 'AutoCAD' started by AJacques, May 5, 2004.

  1. AJacques

    AJacques Guest

    All,
    hellpppppppppppppp all, hope fully some1 has come across my problem before.
    1. i have added a form to the plot button so that when i click on the plot button a form pops up for me to select a drawing stamp regarding the status of the drawing b4 it is printed however when i plot preview the form still shows, how can i resolve this but still have the form pop up when the plotting process is finished :

    CODE:

    Me.Hide
    ThisDrawing.SendCommand "PLOT "
    Me.Show vbModeless

    THANKS
     
    AJacques, May 5, 2004
    #1
  2. AJacques

    Ed Jobe Guest

    You need to use the BeginPlot event.

    Add the following to a class module called MyEvents (or whatever):
    <code block>
    Option Explicit

    Public WithEvents App As AcadApplication
    Public WithEvents Doc As AcadDocument

    Private Sub App_BeginPlot(ByVal DrawingName As String)

    ' add your pre-processing code here

    End Sub
    </code block>

    Then add the following to a standard module:
    <code block>
    Option Explicit

    Dim X As New MyEvents

    Sub Stamp()
    Set X.App = ThisDrawing.Application
    End Sub
    </code block>

    Now you just need to run the Stamp macro to get things started.



    --
    ----
    Ed
    ----
    All,
    hellpppppppppppppp all, hope fully some1 has come across my problem before.
    1. i have added a form to the plot button so that when i click on the plot button a form pops up for me to select a drawing stamp regarding the status of the drawing b4 it is printed however when i plot preview the form still shows, how can i resolve this but still have the form pop up when the plotting process is finished :

    CODE:

    Me.Hide
    ThisDrawing.SendCommand "PLOT "
    Me.Show vbModeless

    THANKS
     
    Ed Jobe, May 5, 2004
    #2
  3. AJacques

    AJacques Guest

    Thanks Ed, But could you explain a bit more on your code b4 i use it thanks.

    Adrian
     
    AJacques, May 6, 2004
    #3
  4. AJacques

    AJacques Guest

    thanks ED, ive sorted it but is there a end plot command so i can bring this form up again to reset some layers ?
     
    AJacques, May 6, 2004
    #4
  5. AJacques

    Ed Jobe Guest

    Sure. Now that you've declared an application object in the Declarations section, the ide is able to show you all it's methods and events. Put your cursor in the BeginPlot event procedure. Then drop down the listbox in the upper right and click on the EndPlot event and the ide will add the procedure signature to your module. You can also find an object's events/methods/properties in the Object Browser and then click on the ? to get help on that method.
     
    Ed Jobe, May 6, 2004
    #5
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.