我还在学习vb。net编程。
在我的工作中,我做了一个自定义绘图命令。用户选择表单上的某个部门和要打印的窗口。之后,我根据他选择的部门更改了一些属性。
在我的计算机上(winxp 32位、acad 2008和acad 2012),我没有错误。但在另一台计算机(win7 64位,acad 2012 64位)上有一个ELOCKVIOLATION错误。所有其他功能在两台计算机上都运行良好。
“acPlEng”之前会弹出错误。BeginPage命令
有人有什么解决方法吗???
在该代码之前,我输入了打印机、纸张大小和打印样式
[size=2][color=#0000ff][size=2][color=#0000ff]If[/color][/size][/color][/size][size=2] PlotFactory.ProcessPlotState = Autodesk.AutoCAD.PlottingServices.ProcessPlotState.NotPlotting [/size][size=2][color=#0000ff][size=2][color=#0000ff]Then[/color][/size][/color][/size][size=2][color=#0000ff][size=2][color=#0000ff]Using[/color][/size][/color][/size][size=2] acPlEng [/size][size=2][color=#0000ff][size=2][color=#0000ff]As[/color][/size][/color][/size][size=2] PlotEngine = PlotFactory.CreatePublishEngine()[/size][size=2][color=#008000][size=2][color=#008000]'' Track the plot progress with a Progress dialog[/color][/size][/color][/size][size=2][color=#0000ff][size=2][color=#0000ff]Dim[/color][/size][/color][/size][size=2] acPlProgDlg [/size][size=2][color=#0000ff][size=2][color=#0000ff]As[/color][/size][/color][/size][size=2] PlotProgressDialog = [/size][size=2][color=#0000ff][size=2][color=#0000ff]New[/color][/size][/color][/size][size=2] PlotProgressDialog([/size][size=2][color=#0000ff][size=2][color=#0000ff]False[/color][/size][/color][/size][size=2], 1, [/size][size=2][color=#0000ff][size=2][color=#0000ff]True[/color][/size][/color][/size][size=2])[/size][size=2][color=#0000ff][size=2][color=#0000ff]Using[/color][/size][/color][/size][size=2] (acPlProgDlg)[/size][size=2][color=#008000][size=2][color=#008000]'' Define the status messages to display when plotting starts[/color][/size][/color][/size][size=2]acPlProgDlg.PlotMsgString(PlotMessageIndex.DialogTitle) = [/size][size=2][color=#a31515][size=2][color=#a31515]"Plot Progress"[/color][/size][/color][/size][size=2]acPlProgDlg.PlotMsgString(PlotMessageIndex.CancelJobButtonMessage) = [/size][size=2][color=#a31515][size=2][color=#a31515]"Cancel Job"[/color][/size][/color][/size][size=2]acPlProgDlg.PlotMsgString(PlotMessageIndex.CancelSheetButtonMessage) = [/size][size=2][color=#a31515][size=2][color=#a31515]"Cancel Sheet"[/color][/size][/color][/size][size=2]acPlProgDlg.PlotMsgString(PlotMessageIndex.SheetSetProgressCaption) = [/size][size=2][color=#a31515][size=2][color=#a31515]"Sheet Set Progress"[/color][/size][/color][/size][size=2]acPlProgDlg.PlotMsgString(PlotMessageIndex.SheetProgressCaption) = [/size][size=2][color=#a31515][size=2][color=#a31515]"Sheet Progress"[/color][/size][/color][/size][size=2][color=#008000][size=2][color=#008000]'' Set the plot progress range[/color][/size][/color][/size][size=2]acPlProgDlg.LowerPlotProgressRange = 0[/size][size=2]acPlProgDlg.UpperPlotProgressRange = 100[/size][size=2]acPlProgDlg.PlotProgressPos = 0[/size][size=2][color=#008000][size=2][color=#008000]'' Display the Progress dialog[/color][/size][/color][/size][size=2]acPlProgDlg.OnBeginPlot()[/size][size=2]acPlProgDlg.IsVisible = [/size][size=2][color=#0000ff][size=2][color=#0000ff]True[/color][/size][/color][/size][size=2][color=#008000][size=2][color=#008000]'' Start to plot the layout[/color][/size][/color][/size][size=2]acPlEng.BeginPlot(acPlProgDlg, [/size][size=2][color=#0000ff][size=2][color=#0000ff]Nothing[/color][/size][/color][/size][size=2])[/size][size=2][color=#008000][size=2][color=#008000]'' Define the plot output[/color][/size][/color][/size][size=2][color=#008000][size=2][color=#008000]'acPlEng.BeginDocument(acPlInfo, acDoc.Name, Nothing, 1, True, "c:\myplot")[/color][/size][/color][/size][size=2]acPlEng.BeginDocument(acPlInfo, acDoc.Name, [/size][size=2][color=#0000ff][size=2][color=#0000ff]Nothing[/color][/size][/color][/size][size=2], 1, [/size][size=2][color=#0000ff][size=2][color=#0000ff]False[/color][/size][/color][/size][size=2], [/size][size=2][color=#a31515][size=2][color=#a31515]"c:\myplot"[/color][/size][/color][/size][size=2])[/size][size=2][color=#008000][size=2][color=#008000]'' Display information about the current plot[/color][/size][/color][/size][size=2]acPlProgDlg.PlotMsgString(PlotMessageIndex.Status) = [/size][size=2][color=#a31515][size=2][color=#a31515]"Plotting: "[/color][/size][/color][/size][size=2] & acDoc.Name & [/size][size=2][color=#a31515][size=2][color=#a31515]" - "[/color][/size][/color][/size][size=2] & acLayout.LayoutName[/size][size=2][color=#008000][size=2][color=#008000]'' Set the sheet progress range[/color][/size][/color][/size][size=2]acPlProgDlg.OnBeginSheet()[/size][size=2]acPlProgDlg.LowerSheetProgressRange = 0[/size][size=2]acPlProgDlg.UpperSheetProgressRange = 100[/size][size=2]acPlProgDlg.SheetProgressPos = 0[/size][size=2]' the error apear here[/size][size=2][color=#008000][size=2][color=#008000]'' Plot the first sheet/layout[/color][/size][/color][/size][size=2][color=#0000ff][size=2][color=#0000ff]Dim[/color][/size][/color][/size][size=2] acPlPageInfo [/size][size=2][color=#0000ff][size=2][color=#0000ff]As[/color][/size][/color][/size][size=2] PlotPageInfo = [/size][size=2][color=#0000ff][size=2][color=#0000ff]New[/color][/size][/color][/size][size=2] PlotPageInfo()[/size][size=2]acPlEng.BeginPage(acPlPageInfo, acPlInfo, [/size][size=2][color=#0000ff][size=2][color=#0000ff]True[/color][/size][/color][/size][size=2], [/size][size=2][color=#0000ff][size=2][color=#0000ff]Nothing[/color][/size][/color][/size][size=2])[/size][size=2]acPlEng.BeginGenerateGraphics([/size][size=2][color=#0000ff][size=2][color=#0000ff]Nothing[/color][/size][/color][/size][size=2])[/size][size=2]acPlEng.EndGenerateGraphics([/size][size=2][color=#0000ff][size=2][color=#0000ff]Nothing[/color][/size][/color][/size][size=2])[/size][size=2][color=#008000][size=2][color=#008000]'' Finish plotting the sheet/layout[/color][/size][/color][/size][size=2]acPlEng.EndPage([/size][size=2][color=#0000ff][size=2][color=#0000ff]Nothing[/color][/size][/color][/size][size=2])[/size][size=2]acPlProgDlg.SheetProgressPos = 100[/size][size=2]acPlProgDlg.OnEndSheet()[/size][size=2][color=#008000][size=2][color=#008000]'' Finish plotting the document[/color][/size][/color][/size][size=2]acPlEng.EndDocument([/size][size=2][color=#0000ff][size=2][color=#0000ff]Nothing[/color][/size][/color][/size][size=2])[/size][size=2][color=#008000][size=2][color=#008000]'' Finish the plot[/color][/size][/color][/size][size=2]acPlProgDlg.PlotProgressPos = 100[/size][size=2]acPlProgDlg.OnEndPlot()[/size][size=2]acPlEng.EndPlot([/size][size=2][color=#0000ff][size=2][color=#0000ff]Nothing[/color][/size][/color][/size][size=2])[/size][size=2][color=#0000ff][size=2][color=#0000ff]End[/color][/size][/color][/size][size=2][color=#0000ff][size=2][color=#0000ff]Using[/color][/size][/color][/size][size=2][color=#0000ff][size=2][color=#0000ff]End[/color][/size][/color][/size][size=2][color=#0000ff][size=2][color=#0000ff]Using[/color][/size][/color][/size][size=2][color=#0000ff][size=2][color=#0000ff]End[/color][/size][/color][/size][size=2][color=#0000ff][size=2][color=#0000ff]If[/color][/size][/color][/size]