1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
If PlotFactory.ProcessPlotState = Autodesk.AutoCAD.PlottingServices.ProcessPlotState.NotPlotting Then
Using acPlEng As PlotEngine = PlotFactory.CreatePublishEngine()
'' Track the plot progress with a Progress dialog
Dim acPlProgDlg As PlotProgressDialog = New PlotProgressDialog(False, 1, True)
Using (acPlProgDlg)
'' Define the status messages to display when plotting starts
acPlProgDlg.PlotMsgString(PlotMessageIndex.DialogTitle) = "Plot Progress"
acPlProgDlg.PlotMsgString(PlotMessageIndex.CancelJobButtonMessage) = "Cancel Job"
acPlProgDlg.PlotMsgString(PlotMessageIndex.CancelSheetButtonMessage) = "Cancel Sheet"
acPlProgDlg.PlotMsgString(PlotMessageIndex.SheetSetProgressCaption) = "Sheet Set Progress"
acPlProgDlg.PlotMsgString(PlotMessageIndex.SheetProgressCaption) = "Sheet Progress"
'' Set the plot progress range
acPlProgDlg.LowerPlotProgressRange = 0
acPlProgDlg.UpperPlotProgressRange = 100
acPlProgDlg.PlotProgressPos = 0
'' Display the Progress dialog
acPlProgDlg.OnBeginPlot()
acPlProgDlg.IsVisible = True
'' Start to plot the layout
acPlEng.BeginPlot(acPlProgDlg, Nothing)
'' Define the plot output
'acPlEng.BeginDocument(acPlInfo, acDoc.Name, Nothing, 1, True, "c:\myplot")
acPlEng.BeginDocument(acPlInfo, acDoc.Name, Nothing, 1, False, "c:\myplot")
'' Display information about the current plot
acPlProgDlg.PlotMsgString(PlotMessageIndex.Status) = "Plotting: " & acDoc.Name & " - " & acLayout.LayoutName
'' Set the sheet progress range
acPlProgDlg.OnBeginSheet()
acPlProgDlg.LowerSheetProgressRange = 0
acPlProgDlg.UpperSheetProgressRange = 100
acPlProgDlg.SheetProgressPos = 0
'l'erreur arrive ici
'' Plot the first sheet/layout
Dim acPlPageInfo As PlotPageInfo = New PlotPageInfo()
acPlEng.BeginPage(acPlPageInfo, acPlInfo, True, Nothing)
acPlEng.BeginGenerateGraphics(Nothing)
acPlEng.EndGenerateGraphics(Nothing)
'' Finish plotting the sheet/layout
acPlEng.EndPage(Nothing)
acPlProgDlg.SheetProgressPos = 100
acPlProgDlg.OnEndSheet()
'' Finish plotting the document
acPlEng.EndDocument(Nothing)
'' Finish the plot
acPlProgDlg.PlotProgressPos = 100
acPlProgDlg.OnEndPlot()
acPlEng.EndPlot(Nothing)
EndUsing
EndUsing
EndIf |
Partager