EndPlot Event trouble

Discussion in 'AutoCAD' started by SKAcadman, Sep 17, 2004.

  1. SKAcadman

    SKAcadman Guest

    Question:

    The company I work for requires that we keep track of all plots to recoup printing costs. When we switched o AutoCAD 2000i, I wrote a visual basic routine that reads the file name that was plotted, which user plotted the file, asks the user what size paper was used and if the plot is billable. The report would then record the plot in one of three databases depending upon which office the user works in. The accounting department then used these databases to bill the client for materials. This program ran fine in AutoCAD 2004 with one exception; I did have to disable the PREVIEW command, because it was triggering the report, but we felt that was not a major inconvenience because the user could still preview the drawing from the plot dialog box.

    Now I am testing AutoCAD 2005. With the new plotting interface, if the user previews the drawing from the plot dialog box (which I encourage to make sure the plot is correct before wasting the paper), it triggers a report even though nothing has been plotted as of yet. If the CAD operator cancels the plot at this point, a report has already been sent to accounting. If the operator determines that the plot is correct, and sends the plot to a device, the plot triggers another report to accounting. This results in double reporting.

    I can’t just set the report with “stock†information, because this program has to be flexible enough to work for 3 different office locations, multiple plotters, and 30+ CAD operators (plus engineers plotting their own drawings). I also cannot simply place an “exit†in the report other than completing and submitting the report to accounting (This is management’s way of ensuring that the reports are used).

    The VBA code I am using to trigger the plot report is as follows:

    Private Sub AcadDocument_EndPlot(ByVal DrawingName As String)
    If ThisDrawing.GetVariable("Diastat") = 1 Then ‘Cancel was not selected
    PlotReport ‘ Run plot report sub
    End If ‘ end if
    End Sub

    Any ideas how I can capture the plot event only if the plot goes to a valid plot device?

    Our production staff will not be changing to 2005 (for cost reasons) but I need to beat this problem before 2006 is released (I expect they will use the same plot engine).

    Thanks to all for your help.
     
    SKAcadman, Sep 17, 2004
    #1
  2. Any ideas how I can capture the plot event only if the plot goes to a valid plot device?
    Yeah, if you require that much control, write your own replacement plot
    dialog. Then disable the plot command and replace it with yours.
    While it may be true, I wouldn't bet the farm on it =)

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Sep 18, 2004
    #2
  3. Hi,

    as a guess, could there be a variable you could check to know if it is a
    preview or plot that was triggered ?

    Gilles
     
    Gilles Plante, Sep 21, 2004
    #3
  4. Not that I know of, plus with the amount of control he wants, the only
    answer is to write a replacement.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Sep 21, 2004
    #4
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.