<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to open DWG file in Autocad 2009 in C# ? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505670#M70096</link>
    <description>What's wrong Joe,  err... I mean 'steve', you don't like it&lt;BR /&gt;
when someone points out just how helpless you actually are?&lt;BR /&gt;
&lt;BR /&gt;
You don't know what you're doing, and everyone around&lt;BR /&gt;
here knows it, so just give it up.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Joe Sutphin" &lt;JOESUTPHIN&gt; wrote in message &lt;BR /&gt;
news:6201061@discussion.autodesk.com...&lt;BR /&gt;
You must have seen yourself in the mirror - I'd be laughing too.&lt;BR /&gt;
&lt;BR /&gt;
Joe ...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6201006@discussion.autodesk.com...&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
Joe Sutphin wrote:&lt;BR /&gt;
&lt;BR /&gt;
Here's how you would do it in VB - I'll leave it to you to convert.&lt;BR /&gt;
&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
He doesn't have to convert it, because what you posted is the&lt;BR /&gt;
C# code from his original post, converted to VB.NET, exactly.&lt;BR /&gt;
&lt;BR /&gt;
ROTFL&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;/TONY.TANZILLO&gt;&lt;/JOESUTPHIN&gt;</description>
    <pubDate>Fri, 12 Jun 2009 21:33:18 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-06-12T21:33:18Z</dc:date>
    <item>
      <title>How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505663#M70089</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I'm developping a dll for Autocad 2009.&lt;BR /&gt;
&lt;BR /&gt;
I would like to know, how to open a DWG file ?&lt;BR /&gt;
&lt;BR /&gt;
I tried :&lt;BR /&gt;
Database db = new Database();&lt;BR /&gt;
db.ReadDwgFile(file.Path, FileOpenMode.OpenForReadAndAllShare, true, "");&lt;BR /&gt;
---&amp;gt; does nothing&lt;BR /&gt;
&lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open(file.Path);&lt;BR /&gt;
--&amp;gt; Error concerning Execution Context.&lt;BR /&gt;
&lt;BR /&gt;
Thank you</description>
      <pubDate>Fri, 12 Jun 2009 15:47:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505663#M70089</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-12T15:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505664#M70090</link>
      <description>&lt;DIV id="jive-html-wrapper-div"&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;Here's how you would do it in VB - I'll leave it to &lt;BR /&gt;
you to convert.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;Joe ...&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;&lt;FONT color="#0000ff" size="2"&gt;&lt;FONT color="#0000ff"&gt;&lt;BR /&gt;
size=2&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;&lt;FONT color="#0000ff" size="2"&gt;&lt;FONT color="#0000ff"&gt;&lt;BR /&gt;
size=2&amp;gt;Imports&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt; oAcadApp = &lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
&lt;P&gt;oAcadApp.DocumentManager.Open(&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color="#a31515" size="2"&gt;&lt;FONT&gt;&lt;BR /&gt;
color=#a31515 size=2&amp;gt;"C:\Drawing1.dwg"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;, &lt;/FONT&gt;&lt;FONT&gt;&lt;BR /&gt;
color=#0000ff size=2&amp;gt;&lt;FONT color="#0000ff" size="2"&gt;False&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT&gt;&lt;BR /&gt;
size=2&amp;gt;, &lt;/FONT&gt;&lt;FONT color="#a31515" size="2"&gt;&lt;FONT color="#a31515"&gt;&lt;BR /&gt;
size=2&amp;gt;""&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;)&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;&amp;lt;wperaud&amp;gt; wrote in message &lt;A&gt;&lt;BR /&gt;
  href="news:6200812@discussion.autodesk.com"&amp;gt;news:6200812@discussion.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;Hello, &lt;BR /&gt;
  I'm developping a dll for Autocad 2009. I would like to know, how to open a &lt;BR /&gt;
  DWG file ? I tried : Database db = new Database(); db.ReadDwgFile(file.Path, &lt;BR /&gt;
  FileOpenMode.OpenForReadAndAllShare, true, ""); ---&amp;gt; does nothing &lt;BR /&gt;
  Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open(file.Path); &lt;BR /&gt;
  --&amp;gt; Error concerning Execution Context. Thank you&lt;/BLOCKQUOTE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 12 Jun 2009 17:52:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505664#M70090</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-12T17:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505665#M70091</link>
      <description>You can't open a drawing file from a command handler unless&lt;BR /&gt;
you specify CommandFlags.Session in the CommandMethod&lt;BR /&gt;
attribute.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;WPERAUD&gt; wrote in message news:6200812@discussion.autodesk.com...&lt;BR /&gt;
Hello, I'm developping a dll for Autocad 2009. I would like to know, how to &lt;BR /&gt;
open a DWG file ? I tried : Database db = new Database(); &lt;BR /&gt;
db.ReadDwgFile(file.Path, FileOpenMode.OpenForReadAndAllShare, true, &lt;BR /&gt;
""); ---&amp;gt; does nothing &lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open(file.Path); &lt;BR /&gt;
 --&amp;gt; Error concerning Execution Context. Thank you&lt;/WPERAUD&gt;</description>
      <pubDate>Fri, 12 Jun 2009 18:52:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505665#M70091</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-12T18:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505666#M70092</link>
      <description>{quote}&lt;BR /&gt;
&lt;BR /&gt;
Joe Sutphin wrote:&lt;BR /&gt;
&lt;BR /&gt;
Here's how you would do it in VB - I'll leave it to you to convert.&lt;BR /&gt;
&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
He doesn't have to convert it, because what you posted is the&lt;BR /&gt;
C# code from his original post, converted to VB.NET, exactly.&lt;BR /&gt;
&lt;BR /&gt;
ROTFL&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");</description>
      <pubDate>Fri, 12 Jun 2009 18:52:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505666#M70092</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-12T18:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505667#M70093</link>
      <description>You may have to do that in C# but not in VB.&lt;BR /&gt;
&lt;BR /&gt;
Joe ...&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:6201005@discussion.autodesk.com...&lt;BR /&gt;
You can't open a drawing file from a command handler unless&lt;BR /&gt;
you specify CommandFlags.Session in the CommandMethod&lt;BR /&gt;
attribute.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;WPERAUD&gt; wrote in message news:6200812@discussion.autodesk.com...&lt;BR /&gt;
Hello, I'm developping a dll for Autocad 2009. I would like to know, how to&lt;BR /&gt;
open a DWG file ? I tried : Database db = new Database();&lt;BR /&gt;
db.ReadDwgFile(file.Path, FileOpenMode.OpenForReadAndAllShare, true,&lt;BR /&gt;
""); ---&amp;gt; does nothing&lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open(file.Path);&lt;BR /&gt;
 --&amp;gt; Error concerning Execution Context. Thank you&lt;/WPERAUD&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Fri, 12 Jun 2009 19:58:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505667#M70093</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-12T19:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505668#M70094</link>
      <description>You must have seen yourself in the mirror - I'd be laughing too.&lt;BR /&gt;
&lt;BR /&gt;
Joe ...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:6201006@discussion.autodesk.com...&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
Joe Sutphin wrote:&lt;BR /&gt;
&lt;BR /&gt;
Here's how you would do it in VB - I'll leave it to you to convert.&lt;BR /&gt;
&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
He doesn't have to convert it, because what you posted is the&lt;BR /&gt;
C# code from his original post, converted to VB.NET, exactly.&lt;BR /&gt;
&lt;BR /&gt;
ROTFL&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Fri, 12 Jun 2009 20:02:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505668#M70094</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-12T20:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505669#M70095</link>
      <description>Wrong again, Bozo.&lt;BR /&gt;
&lt;BR /&gt;
AutoCAD has no idea what langauge a .NET program was written in.&lt;BR /&gt;
&lt;BR /&gt;
You're about as dumb as they get.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Joe Sutphin" &lt;JOESUTPHIN&gt; wrote in message &lt;BR /&gt;
news:6201060@discussion.autodesk.com...&lt;BR /&gt;
You may have to do that in C# but not in VB.&lt;BR /&gt;
&lt;BR /&gt;
Joe ...&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6201005@discussion.autodesk.com...&lt;BR /&gt;
You can't open a drawing file from a command handler unless&lt;BR /&gt;
you specify CommandFlags.Session in the CommandMethod&lt;BR /&gt;
attribute.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;WPERAUD&gt; wrote in message news:6200812@discussion.autodesk.com...&lt;BR /&gt;
Hello, I'm developping a dll for Autocad 2009. I would like to know, how to&lt;BR /&gt;
open a DWG file ? I tried : Database db = new Database();&lt;BR /&gt;
db.ReadDwgFile(file.Path, FileOpenMode.OpenForReadAndAllShare, true,&lt;BR /&gt;
""); ---&amp;gt; does nothing&lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open(file.Path);&lt;BR /&gt;
 --&amp;gt; Error concerning Execution Context. Thank you&lt;/WPERAUD&gt;&lt;/TONY.TANZILLO&gt;&lt;/JOESUTPHIN&gt;</description>
      <pubDate>Fri, 12 Jun 2009 21:22:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505669#M70095</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-12T21:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505670#M70096</link>
      <description>What's wrong Joe,  err... I mean 'steve', you don't like it&lt;BR /&gt;
when someone points out just how helpless you actually are?&lt;BR /&gt;
&lt;BR /&gt;
You don't know what you're doing, and everyone around&lt;BR /&gt;
here knows it, so just give it up.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Joe Sutphin" &lt;JOESUTPHIN&gt; wrote in message &lt;BR /&gt;
news:6201061@discussion.autodesk.com...&lt;BR /&gt;
You must have seen yourself in the mirror - I'd be laughing too.&lt;BR /&gt;
&lt;BR /&gt;
Joe ...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6201006@discussion.autodesk.com...&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
Joe Sutphin wrote:&lt;BR /&gt;
&lt;BR /&gt;
Here's how you would do it in VB - I'll leave it to you to convert.&lt;BR /&gt;
&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
He doesn't have to convert it, because what you posted is the&lt;BR /&gt;
C# code from his original post, converted to VB.NET, exactly.&lt;BR /&gt;
&lt;BR /&gt;
ROTFL&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;/TONY.TANZILLO&gt;&lt;/JOESUTPHIN&gt;</description>
      <pubDate>Fri, 12 Jun 2009 21:33:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505670#M70096</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-12T21:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505671#M70097</link>
      <description>Obviously you're shooting off your mouth again without knowing what you're &lt;BR /&gt;
talking about.&lt;BR /&gt;
&lt;BR /&gt;
I run my code before I post it. Enough said?&lt;BR /&gt;
&lt;BR /&gt;
It works just fine the way I posted. Once again you don't everything [or &lt;BR /&gt;
even anything for that matter] especially when it comes to VB.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Joe ...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:6201116@discussion.autodesk.com...&lt;BR /&gt;
Wrong again, Bozo.&lt;BR /&gt;
&lt;BR /&gt;
AutoCAD has no idea what langauge a .NET program was written in.&lt;BR /&gt;
&lt;BR /&gt;
You're about as dumb as they get.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Joe Sutphin" &lt;JOESUTPHIN&gt; wrote in message&lt;BR /&gt;
news:6201060@discussion.autodesk.com...&lt;BR /&gt;
You may have to do that in C# but not in VB.&lt;BR /&gt;
&lt;BR /&gt;
Joe ...&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6201005@discussion.autodesk.com...&lt;BR /&gt;
You can't open a drawing file from a command handler unless&lt;BR /&gt;
you specify CommandFlags.Session in the CommandMethod&lt;BR /&gt;
attribute.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;WPERAUD&gt; wrote in message news:6200812@discussion.autodesk.com...&lt;BR /&gt;
Hello, I'm developping a dll for Autocad 2009. I would like to know, how to&lt;BR /&gt;
open a DWG file ? I tried : Database db = new Database();&lt;BR /&gt;
db.ReadDwgFile(file.Path, FileOpenMode.OpenForReadAndAllShare, true,&lt;BR /&gt;
""); ---&amp;gt; does nothing&lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open(file.Path);&lt;BR /&gt;
 --&amp;gt; Error concerning Execution Context. Thank you&lt;/WPERAUD&gt;&lt;/TONY.TANZILLO&gt;&lt;/JOESUTPHIN&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Fri, 12 Jun 2009 22:14:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505671#M70097</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-12T22:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505672#M70098</link>
      <description>You lame ass moron - you're the one that does know what they're talking &lt;BR /&gt;
about.&lt;BR /&gt;
&lt;BR /&gt;
Guess it's time for you to get up off the floor and figure out what you did &lt;BR /&gt;
wrong.&lt;BR /&gt;
&lt;BR /&gt;
Joe ...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:6201120@discussion.autodesk.com...&lt;BR /&gt;
What's wrong Joe,  err... I mean 'steve', you don't like it&lt;BR /&gt;
when someone points out just how helpless you actually are?&lt;BR /&gt;
&lt;BR /&gt;
You don't know what you're doing, and everyone around&lt;BR /&gt;
here knows it, so just give it up.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Joe Sutphin" &lt;JOESUTPHIN&gt; wrote in message&lt;BR /&gt;
news:6201061@discussion.autodesk.com...&lt;BR /&gt;
You must have seen yourself in the mirror - I'd be laughing too.&lt;BR /&gt;
&lt;BR /&gt;
Joe ...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:6201006@discussion.autodesk.com...&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
Joe Sutphin wrote:&lt;BR /&gt;
&lt;BR /&gt;
Here's how you would do it in VB - I'll leave it to you to convert.&lt;BR /&gt;
&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
He doesn't have to convert it, because what you posted is the&lt;BR /&gt;
C# code from his original post, converted to VB.NET, exactly.&lt;BR /&gt;
&lt;BR /&gt;
ROTFL&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;/TONY.TANZILLO&gt;&lt;/JOESUTPHIN&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Fri, 12 Jun 2009 22:16:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505672#M70098</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-12T22:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505673#M70099</link>
      <description>&lt;DIV id="jive-html-wrapper-div"&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;at the risk of starting an extended discussion &lt;BR /&gt;
...&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;{quote}Re: How to open DWG file in Autocad 2009 in &lt;BR /&gt;
C# ?&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;{quote}&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;to you, Does OPEN mean visible in the &lt;BR /&gt;
Editor&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;or open in a database .. ?&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;{code}&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
//CodeHimBelongaKdub ©&amp;nbsp; &lt;BR /&gt;
June2009&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [CommandMethod("testOPEN", &lt;BR /&gt;
CommandFlags.Session)]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static &lt;BR /&gt;
public void testyOpen()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
DocumentCollection dm = &lt;BR /&gt;
AcadApp.DocumentManager;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
Editor ed = dm.MdiActiveDocument.Editor;&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
face=Arial&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
PromptOpenFileOptions POFO = new &lt;BR /&gt;
PromptOpenFileOptions(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
"Select a drawing file" );&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
face=Arial&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
POFO.InitialDirectory = &lt;BR /&gt;
"F:\\_KDUB_DEV";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
POFO.Filter = "AutoCAD DWG Files|*.dwg|AutoCAD DXF Files|*.dxf";&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
face=Arial&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
POFO.DialogCaption = "Select a file, &lt;BR /&gt;
dude.";&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
face=Arial&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
PromptFileNameResult pr = ed.GetFileNameForOpen(POFO);&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;
face=Arial&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if &lt;BR /&gt;
(pr.Status == &lt;BR /&gt;
PromptStatus.OK)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
dm.Open(pr.StringResult);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;
}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;{code}&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT size="2" face="Arial"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;"wperaud" wrote in message &lt;A&gt;&lt;BR /&gt;
title="news:6200812@discussion.autodesk.com
CTRL + Click to follow link" &lt;BR /&gt;
href="news:6200812@discussion.autodesk.com"&amp;gt;news:6200812@discussion.autodesk.com&lt;/A&gt;...&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px"&amp;gt;Hello, &lt;BR /&gt;
  I'm developping a dll for Autocad 2009. I would like to know, how to open a &lt;BR /&gt;
  DWG file ? I tried : Database db = new Database(); db.ReadDwgFile(file.Path, &lt;BR /&gt;
  FileOpenMode.OpenForReadAndAllShare, true, ""); ---&amp;gt; does nothing &lt;BR /&gt;
  Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open(file.Path); &lt;BR /&gt;
  --&amp;gt; Error concerning Execution Context. Thank you&lt;/BLOCKQUOTE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 13 Jun 2009 08:00:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505673#M70099</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-13T08:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505674#M70100</link>
      <description>I really dislike the formatting on this forum !&lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
        //CodeHimBelongaKdub ©  June2009&lt;BR /&gt;
        &lt;BR /&gt;
        [CommandMethod("testOPEN", CommandFlags.Session)]&lt;BR /&gt;
        static public void testyOpen()&lt;BR /&gt;
        {&lt;BR /&gt;
            DocumentCollection dm = AcadApp.DocumentManager;&lt;BR /&gt;
            Editor ed = dm.MdiActiveDocument.Editor;&lt;BR /&gt;
&lt;BR /&gt;
            PromptOpenFileOptions POFO = new PromptOpenFileOptions(&lt;BR /&gt;
                "Select a drawing file" );&lt;BR /&gt;
&lt;BR /&gt;
            POFO.InitialDirectory = "F:\\_KDUB_DEV";&lt;BR /&gt;
            POFO.Filter = "AutoCAD DWG Files|*.dwg|AutoCAD DXF Files|*.dxf";&lt;BR /&gt;
&lt;BR /&gt;
            POFO.DialogCaption = "Select a file, dude.";           &lt;BR /&gt;
&lt;BR /&gt;
            PromptFileNameResult pr = ed.GetFileNameForOpen(POFO);&lt;BR /&gt;
&lt;BR /&gt;
            if (pr.Status == PromptStatus.OK)&lt;BR /&gt;
            {&lt;BR /&gt;
                dm.Open(pr.StringResult);&lt;BR /&gt;
            }&lt;BR /&gt;
        }&lt;BR /&gt;
{code}</description>
      <pubDate>Sat, 13 Jun 2009 08:17:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505674#M70100</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2009-06-13T08:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505675#M70101</link>
      <description>{quote}&lt;BR /&gt;
&lt;BR /&gt;
Obviously you're shooting off your mouth again without knowing what you're&lt;BR /&gt;
talking about.&lt;BR /&gt;
&lt;BR /&gt;
I run my code before I post it. Enough said?&lt;BR /&gt;
&lt;BR /&gt;
It works just fine the way I posted. Once again you don't everything [or&lt;BR /&gt;
even anything for that matter] especially when it comes to VB.&lt;BR /&gt;
&lt;BR /&gt;
{quote}&lt;BR /&gt;
&lt;BR /&gt;
What works fine just the way you posted?  Opening the document?&lt;BR /&gt;
&lt;BR /&gt;
Duh!&lt;BR /&gt;
&lt;BR /&gt;
Merely opening the document is not the problem. It never was. That isn't &lt;BR /&gt;
what doesn't work.&lt;BR /&gt;
&lt;BR /&gt;
Activating the opened document in order to use it to do anything that &lt;BR /&gt;
requires the document to be active, is the problem..... stupid.&lt;BR /&gt;
&lt;BR /&gt;
And no, doing that does not work without the CommandFlags.Session attribute &lt;BR /&gt;
on the calling code.&lt;BR /&gt;
&lt;BR /&gt;
Once again, we get to see the 'true you'.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");</description>
      <pubDate>Sat, 13 Jun 2009 11:24:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505675#M70101</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-13T11:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505676#M70102</link>
      <description>First of all, thank you everyone.&lt;BR /&gt;
&lt;BR /&gt;
Yes Kerry Brown, when i say that I want to open a file, I want it to be visible, and ready to be modified.&lt;BR /&gt;
&lt;BR /&gt;
****&lt;BR /&gt;
1 : I tried Joe Sutphin's solution.&lt;BR /&gt;
&lt;BR /&gt;
I just had to convert the "Import" line into a "using" one &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
I get the same error just like I said :&lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open(file.Path);&lt;BR /&gt;
--&amp;gt; Error in french "Contexte d'excecution Incorrect"&lt;BR /&gt;
--&amp;gt; Must be quit the same in english : "Excecution Context Incorrect" ?&lt;BR /&gt;
&lt;BR /&gt;
****&lt;BR /&gt;
2 : I tried Kerry Brown's solution&lt;BR /&gt;
&lt;BR /&gt;
If I copy/paste your code to my main class (defined by the "[assembly: CommandClass(typeof(MyClass))]") , it works.&lt;BR /&gt;
&lt;BR /&gt;
Tony Tanzillo is right, CommandFlags.Session attribute has to be mentionned.&lt;BR /&gt;
&lt;BR /&gt;
But this solution doesn't really solve my problem.&lt;BR /&gt;
&lt;BR /&gt;
****&lt;BR /&gt;
My main class (defined by the "[assembly: CommandClass(typeof(MyClass))]"), just enables a custom Ribbon and defines which action has to be called on each button's click.&lt;BR /&gt;
&lt;BR /&gt;
I have a class that manages some local files. It presentes these files in a listview, and when the user double click on the item, I would like to get the filepath and send it to a method that only does "opening file".&lt;BR /&gt;
I aldready get the filePath and send it to the method.&lt;BR /&gt;
&lt;BR /&gt;
For my test, i copied/pasted your code Kenny. (because I works in the main class)&lt;BR /&gt;
&lt;BR /&gt;
I tried :&lt;BR /&gt;
-- adding the CommandFlags above the method&lt;BR /&gt;
-- putting this method as a public static one in the main class&lt;BR /&gt;
---&amp;gt; I keep having the "Execution Context Error"</description>
      <pubDate>Mon, 15 Jun 2009 08:15:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505676#M70102</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-15T08:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505677#M70103</link>
      <description>Yes, you do need the CommandFlags.Session attribute if the call to Open() is &lt;BR /&gt;
made in the command method. But, I'm not clear on where your call to Open() &lt;BR /&gt;
is coming from.&lt;BR /&gt;
&lt;BR /&gt;
Is it coming from a function with the CommandMethod attribute, or from a &lt;BR /&gt;
double-click handler of a form containing a ListView ?  If the latter, is &lt;BR /&gt;
the form being shown modally or modelessly?&lt;BR /&gt;
&lt;BR /&gt;
The easiest way to get help on this, is to try to reproduce the error in a &lt;BR /&gt;
sample project with the minimum code required to cause it to happen, and &lt;BR /&gt;
post the project here.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;WPERAUD&gt; wrote in message news:6201429@discussion.autodesk.com...&lt;BR /&gt;
First of all, thank you everyone. Yes Kerry Brown, when i say that I want to &lt;BR /&gt;
open a file, I want it to be visible, and ready to be modified. **** 1 : I &lt;BR /&gt;
tried Joe Sutphin's solution. I just had to convert the "Import" line into a &lt;BR /&gt;
"using" one &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I get the same error just like I said : &lt;BR /&gt;
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.Open(file.Path); &lt;BR /&gt;
 --&amp;gt; Error in french "Contexte d'excecution Incorrect" --&amp;gt; Must be quit the &lt;BR /&gt;
same in english : "Excecution Context Incorrect" ? **** 2 : I tried Kerry &lt;BR /&gt;
Brown's solution If I copy/paste your code to my main class (defined by the &lt;BR /&gt;
"[assembly: CommandClass(typeof(MyClass))]") , it works. Tony Tanzillo is &lt;BR /&gt;
right, CommandFlags.Session attribute has to be mentionned. But this &lt;BR /&gt;
solution doesn't really solve my problem. **** My main class (defined by the &lt;BR /&gt;
"[assembly: CommandClass(typeof(MyClass))]"), just enables a custom Ribbon &lt;BR /&gt;
and defines which action has to be called on each button's click. I have a &lt;BR /&gt;
class that manages some local files. It presentes these files in a listview, &lt;BR /&gt;
and when the user double click on the item, I would like to get the filepath &lt;BR /&gt;
and send it to a method that only does "opening file". I aldready get the &lt;BR /&gt;
filePath and send it to the method. For my test, i copied/pasted your code &lt;BR /&gt;
Kenny. (because I works in the main class) I tried : -- adding the &lt;BR /&gt;
CommandFlags above the method -- putting this method as a public static one &lt;BR /&gt;
in the main class ---&amp;gt; I keep having the "Execution Context Error"&lt;/WPERAUD&gt;</description>
      <pubDate>Mon, 15 Jun 2009 14:23:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505677#M70103</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-15T14:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505678#M70104</link>
      <description>I attached a zip contening 4 files (3 classes) :&lt;BR /&gt;
--- Class RibbonActions&lt;BR /&gt;
- RessourceDictionary.xaml : defines the GUI&lt;BR /&gt;
- RibbonActions.cs : defines the behavior&lt;BR /&gt;
--- Class Acad&lt;BR /&gt;
Class that defines the assembly&lt;BR /&gt;
--- Class FileManager&lt;BR /&gt;
Class that defines a "file browser" (listView) and the behavior on a double click (Open the file)&lt;BR /&gt;
The Browser is shown as modal :&lt;BR /&gt;
{code}acadApp.ShowModalWindow(FilesManager); {code}&lt;BR /&gt;
********&lt;BR /&gt;
When I put the open file in the createRibbon() of the Acad class ((and add the commandFlags)) , it works&lt;BR /&gt;
When I put the open file in the OpenFile(String filePath) of the FileManager class (( even with flags )), it doen't works (( Execution Context Incorrect ))&lt;BR /&gt;
&lt;BR /&gt;
I hope it would help me being clear &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Mon, 15 Jun 2009 16:12:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505678#M70104</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-15T16:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505679#M70105</link>
      <description>The reason you're having this problem is because WPF executes&lt;BR /&gt;
control code and events in a non-AutoCAD thread, which means&lt;BR /&gt;
that you can't do very much with the AutoCAD API from a handler&lt;BR /&gt;
of a WPF UI element.&lt;BR /&gt;
&lt;BR /&gt;
One way to deal with it is to define a standard AutoCAD command&lt;BR /&gt;
(which can also have the CommandFlags.Session flag) that calls&lt;BR /&gt;
the Open() method, and then invoke the command using the&lt;BR /&gt;
DocumentCollection's SendStringToExecute() method from the&lt;BR /&gt;
event handler of your ListBox.&lt;BR /&gt;
&lt;BR /&gt;
Another way to do it, is to call the DocumentCollection's&lt;BR /&gt;
ExecuteInApplicationContext() method, and pass it the method&lt;BR /&gt;
that contains the call to Open(), but for that to work, you must&lt;BR /&gt;
close your Window right after calling ExecuteInApplicationContext,&lt;BR /&gt;
because the callback will not run until that happens.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;WPERAUD&gt; wrote in message news:6201743@discussion.autodesk.com...&lt;BR /&gt;
I attached a zip contening 4 files (3 classes) : --- Class RibbonActions - &lt;BR /&gt;
RessourceDictionary.xaml : defines the GUI - RibbonActions.cs : defines the &lt;BR /&gt;
behavior --- Class Acad Class that defines the assembly --- Class &lt;BR /&gt;
FileManager Class that defines a "file browser" (listView) and the behavior &lt;BR /&gt;
on a double click (Open the file) The Browser is shown as modal : &lt;BR /&gt;
{code}acadApp.ShowModalWindow(FilesManager); {code} ******** When I put the &lt;BR /&gt;
open file in the createRibbon() of the Acad class ((and add the &lt;BR /&gt;
commandFlags)) , it works When I put the open file in the OpenFile(String &lt;BR /&gt;
filePath) of the FileManager class (( even with flags )), it doen't works &lt;BR /&gt;
(( Execution Context Incorrect )) I hope it would help me being clear &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/WPERAUD&gt;</description>
      <pubDate>Mon, 15 Jun 2009 18:06:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505679#M70105</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-15T18:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505680#M70106</link>
      <description>Database db = new Database();&lt;BR /&gt;
db.ReadDwgFile(file.Path, FileOpenMode.OpenForReadAndAllShare, true, "");&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Change it to :&lt;BR /&gt;
&lt;BR /&gt;
Database db = new Database(false, true);&lt;BR /&gt;
&lt;BR /&gt;
 using (db)&lt;BR /&gt;
   {&lt;BR /&gt;
       try&lt;BR /&gt;
        {&lt;BR /&gt;
            db.ReadDwgFile(file.Path, FileOpenMode.OpenForReadAndAllShare, false, "");&lt;BR /&gt;
        }&lt;BR /&gt;
        catch (System.Exception)&lt;BR /&gt;
        {&lt;BR /&gt;
            ed.WriteMessage("Error in the location specified");&lt;BR /&gt;
&lt;BR /&gt;
            return;&lt;BR /&gt;
        }&lt;BR /&gt;
.................&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
  private static Editor ed&lt;BR /&gt;
        {&lt;BR /&gt;
            get&lt;BR /&gt;
            {&lt;BR /&gt;
                return Application.DocumentManager.MdiActiveDocument.Editor;&lt;BR /&gt;
            }&lt;BR /&gt;
        }</description>
      <pubDate>Mon, 15 Jun 2009 20:21:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505680#M70106</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-15T20:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505681#M70107</link>
      <description>@apt42 :&lt;BR /&gt;
I tried your solution.&lt;BR /&gt;
Nothing happens. No error, but the drawing doesn't appear.&lt;BR /&gt;
&lt;BR /&gt;
@Tony Tanzillo :&lt;BR /&gt;
I tried the SendStringToExecute solution.&lt;BR /&gt;
I think this solution best suits my application behavior (as I may have to open a file, from elsewhere in the application (( without the listview )) )&lt;BR /&gt;
It works.&lt;BR /&gt;
&lt;BR /&gt;
I just have a last question &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
When I use the SendStringToExecute("testOPEN", false, false, true);&lt;BR /&gt;
The command is writen, but the editor is waiting me to press enter.&lt;BR /&gt;
If I put the last parameter to false, the command isn't written anymore, but, How can I automatically press enter ? ( without doing it with my finger &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; )&lt;BR /&gt;
&lt;BR /&gt;
Thank you all again for your help.</description>
      <pubDate>Tue, 16 Jun 2009 08:27:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505681#M70107</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-16T08:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to open DWG file in Autocad 2009 in C# ?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505682#M70108</link>
      <description>SendStringToExecute("TESTOPEN\n", ...)&lt;BR /&gt;
&lt;BR /&gt;
You have to include a newline at the end of each input.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2009&lt;BR /&gt;
Supporting AutoCAD 2000 through 2009&lt;BR /&gt;
&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
Introducing AcadXTabs 2010:&lt;BR /&gt;
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm&lt;BR /&gt;
&lt;BR /&gt;
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;WPERAUD&gt; wrote in message news:6202235@discussion.autodesk.com...&lt;BR /&gt;
@apt42 : I tried your solution. Nothing happens. No error, but the drawing &lt;BR /&gt;
doesn't appear. @Tony Tanzillo : I tried the SendStringToExecute solution. I &lt;BR /&gt;
think this solution best suits my application behavior (as I may have to &lt;BR /&gt;
open a file, from elsewhere in the application (( without the listview )) ) &lt;BR /&gt;
It works. I just have a last question &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; When I use the &lt;BR /&gt;
SendStringToExecute("testOPEN", false, false, true); The command is writen, &lt;BR /&gt;
but the editor is waiting me to press enter. If I put the last parameter to &lt;BR /&gt;
false, the command isn't written anymore, but, How can I automatically press &lt;BR /&gt;
enter ? ( without doing it with my finger &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ) Thank you all again for your &lt;BR /&gt;
help.&lt;/WPERAUD&gt;</description>
      <pubDate>Tue, 16 Jun 2009 11:57:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-dwg-file-in-autocad-2009-in-c/m-p/2505682#M70108</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-16T11:57:04Z</dc:date>
    </item>
  </channel>
</rss>

