乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 73|回复: 0

[编程交流] 绘图错误

[复制链接]

18

主题

32

帖子

14

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
90
发表于 2022-7-6 22:32:13 | 显示全部楼层 |阅读模式
我还在学习vb。net编程。
 
在我的工作中,我做了一个自定义绘图命令。用户选择表单上的某个部门和要打印的窗口。之后,我根据他选择的部门更改了一些属性。
 
在我的计算机上(winxp 32位、acad 2008和acad 2012),我没有错误。但在另一台计算机(win7 64位,acad 2012 64位)上有一个ELOCKVIOLATION错误。所有其他功能在两台计算机上都运行良好。
 
“acPlEng”之前会弹出错误。BeginPage命令
 
有人有什么解决方法吗???
 
在该代码之前,我输入了打印机、纸张大小和打印样式
 
 
  1. [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]
  2. [/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]
  3. [size=2][color=#008000][size=2][color=#008000]'' Track the plot progress with a Progress dialog[/color][/size]
  4. [/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]
  5. [size=2][color=#0000ff][size=2][color=#0000ff]Using[/color][/size][/color][/size][size=2] (acPlProgDlg)[/size]
  6. [size=2][color=#008000][size=2][color=#008000]'' Define the status messages to display when plotting starts[/color][/size]
  7. [/color][/size][size=2]acPlProgDlg.PlotMsgString(PlotMessageIndex.DialogTitle) = [/size][size=2][color=#a31515][size=2][color=#a31515]"Plot Progress"[/color][/size]
  8. [/color][/size][size=2]acPlProgDlg.PlotMsgString(PlotMessageIndex.CancelJobButtonMessage) = [/size][size=2][color=#a31515][size=2][color=#a31515]"Cancel Job"[/color][/size]
  9. [/color][/size][size=2]acPlProgDlg.PlotMsgString(PlotMessageIndex.CancelSheetButtonMessage) = [/size][size=2][color=#a31515][size=2][color=#a31515]"Cancel Sheet"[/color][/size]
  10. [/color][/size][size=2]acPlProgDlg.PlotMsgString(PlotMessageIndex.SheetSetProgressCaption) = [/size][size=2][color=#a31515][size=2][color=#a31515]"Sheet Set Progress"[/color][/size]
  11. [/color][/size][size=2]acPlProgDlg.PlotMsgString(PlotMessageIndex.SheetProgressCaption) = [/size][size=2][color=#a31515][size=2][color=#a31515]"Sheet Progress"[/color][/size]
  12. [/color][/size][size=2][color=#008000][size=2][color=#008000]'' Set the plot progress range[/color][/size]
  13. [/color][/size][size=2]acPlProgDlg.LowerPlotProgressRange = 0[/size]
  14. [size=2]acPlProgDlg.UpperPlotProgressRange = 100[/size]
  15. [size=2]acPlProgDlg.PlotProgressPos = 0[/size]
  16. [size=2][color=#008000][size=2][color=#008000]'' Display the Progress dialog[/color][/size]
  17. [/color][/size][size=2]acPlProgDlg.OnBeginPlot()[/size]
  18. [size=2]acPlProgDlg.IsVisible = [/size][size=2][color=#0000ff][size=2][color=#0000ff]True[/color][/size]
  19. [/color][/size][size=2][color=#008000][size=2][color=#008000]'' Start to plot the layout[/color][/size]
  20. [/color][/size][size=2]acPlEng.BeginPlot(acPlProgDlg, [/size][size=2][color=#0000ff][size=2][color=#0000ff]Nothing[/color][/size][/color][/size][size=2])[/size]
  21. [size=2][color=#008000][size=2][color=#008000]'' Define the plot output[/color][/size]
  22. [/color][/size][size=2][color=#008000][size=2][color=#008000]'acPlEng.BeginDocument(acPlInfo, acDoc.Name, Nothing, 1, True, "c:\myplot")[/color][/size]
  23. [/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]
  24. [size=2][color=#008000][size=2][color=#008000]'' Display information about the current plot[/color][/size]
  25. [/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]
  26. [size=2][color=#008000][size=2][color=#008000]'' Set the sheet progress range[/color][/size]
  27. [/color][/size][size=2]acPlProgDlg.OnBeginSheet()[/size]
  28. [size=2]acPlProgDlg.LowerSheetProgressRange = 0[/size]
  29. [size=2]acPlProgDlg.UpperSheetProgressRange = 100[/size]
  30. [size=2]acPlProgDlg.SheetProgressPos = 0[/size]
  31. [size=2]' the error apear here[/size]
  32. [size=2][color=#008000][size=2][color=#008000]'' Plot the first sheet/layout[/color][/size]
  33. [/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]
  34. [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]
  35. [size=2]acPlEng.BeginGenerateGraphics([/size][size=2][color=#0000ff][size=2][color=#0000ff]Nothing[/color][/size][/color][/size][size=2])[/size]
  36. [size=2]acPlEng.EndGenerateGraphics([/size][size=2][color=#0000ff][size=2][color=#0000ff]Nothing[/color][/size][/color][/size][size=2])[/size]
  37. [size=2][color=#008000][size=2][color=#008000]'' Finish plotting the sheet/layout[/color][/size]
  38. [/color][/size][size=2]acPlEng.EndPage([/size][size=2][color=#0000ff][size=2][color=#0000ff]Nothing[/color][/size][/color][/size][size=2])[/size]
  39. [size=2]acPlProgDlg.SheetProgressPos = 100[/size]
  40. [size=2]acPlProgDlg.OnEndSheet()[/size]
  41. [size=2][color=#008000][size=2][color=#008000]'' Finish plotting the document[/color][/size]
  42. [/color][/size][size=2]acPlEng.EndDocument([/size][size=2][color=#0000ff][size=2][color=#0000ff]Nothing[/color][/size][/color][/size][size=2])[/size]
  43. [size=2][color=#008000][size=2][color=#008000]'' Finish the plot[/color][/size]
  44. [/color][/size][size=2]acPlProgDlg.PlotProgressPos = 100[/size]
  45. [size=2]acPlProgDlg.OnEndPlot()[/size]
  46. [size=2]acPlEng.EndPlot([/size][size=2][color=#0000ff][size=2][color=#0000ff]Nothing[/color][/size][/color][/size][size=2])[/size]
  47. [size=2][color=#0000ff][size=2][color=#0000ff]End[/color][/size][/color][/size][size=2][color=#0000ff][size=2][color=#0000ff]Using[/color][/size]
  48. [/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]
  49. [/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]
  50. [/color][/size]
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-1-31 20:51 , Processed in 0.796967 second(s), 65 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表