title: Plot dwg file programmatically
body: <p>I have written an application to open and print a dwg file. The plotting process is working correctly; however, when I looked at the Plot and Publish Details window, I saw that the File property is set to <code>&lt;UnSaved Drawing&gt;</code> instead of my dwg file name.</p>
  
  <p>I mean something like this :</p>
  
  <blockquote>
    <p>Sheet :UnsavedDwg_2-Model - Plotted</p>
  
  <pre><code>File : &lt;UnSaved Drawing&gt;&gt; 
  Category name :&gt; 
  Page setup :&gt; 
  Device name : \\server\MyPrinterName&gt; 
  Plot file path :&gt; 
  Paper size : Letter
  </code></pre>
  </blockquote>
  
  <p>what is my mistake?!!!</p>
  
  <p>Note : I have used the <code>Open</code> method of <code>DocumentCollection</code> class to open my dwg file and <a href="http://through-the-interface.typepad.com/through_the_interface/2007/09/driving-a-basic.html" rel="nofollow">this code</a> to plotting the opened dwg file to printer.</p>
  
  <p>My code to open dwg file :</p>
  
  <pre><code>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;
  }
  </code></pre>