metaldan 发表于 2022-7-6 22:32:13

绘图错误

我还在学习vb。net编程。
 
在我的工作中,我做了一个自定义绘图命令。用户选择表单上的某个部门和要打印的窗口。之后,我根据他选择的部门更改了一些属性。
 
在我的计算机上(winxp 32位、acad 2008和acad 2012),我没有错误。但在另一台计算机(win7 64位,acad 2012 64位)上有一个ELOCKVIOLATION错误。所有其他功能在两台计算机上都运行良好。
 
“acPlEng”之前会弹出错误。BeginPage命令
 
有人有什么解决方法吗???
 
在该代码之前,我输入了打印机、纸张大小和打印样式
 
 

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


' the error apear here



'' 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



页: [1]
查看完整版本: 绘图错误