我编写了一个应用程序来打开和打印 dwg 文件。绘图过程正常工作;但是,当我查看 Plot and Publish Details 窗口时,我看到 File 属性设置为<UnSaved Drawing>
而不是我的 dwg 文件名。
我的意思是这样的:
工作表:UnsavedDwg_2-Model - Plotted
File : <UnSaved Drawing>> Category name :> Page setup :> Device name : \\server\MyPrinterName> Plot file path :> Paper size : Letter
我的错是什么?!!!
注意:我使用类的Open
方法DocumentCollection
打开了我的 dwg 文件,并使用此代码将打开的 dwg 文件打印到打印机。
我打开 dwg 文件的代码:
String MyDWGFilePath = @"\\Server\SharedFolder\Projects\File1.dwg";
DocumentCollection dm = Application.DocumentManager;
Document doc = null;
if(File.Exists(MyDWGFilePath))
{
doc = dm.Open(MyDWGFilePath, false);
Application.DocumentManager.MdiActiveDocument = doc;
}