<?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 How to open an auto cad file drawing and select all (whatever obj are in the drawing) in c#? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-to-open-an-auto-cad-file-drawing-and-select-all-whatever-obj/m-p/11003396#M13410</link>
    <description>&lt;P&gt;-&lt;/P&gt;</description>
    <pubDate>Mon, 14 Mar 2022 12:04:09 GMT</pubDate>
    <dc:creator>AmanKumar1</dc:creator>
    <dc:date>2022-03-14T12:04:09Z</dc:date>
    <item>
      <title>How to open an auto cad file drawing and select all (whatever obj are in the drawing) in c#?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-an-auto-cad-file-drawing-and-select-all-whatever-obj/m-p/11003396#M13410</link>
      <description>&lt;P&gt;-&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 12:04:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-an-auto-cad-file-drawing-and-select-all-whatever-obj/m-p/11003396#M13410</guid>
      <dc:creator>AmanKumar1</dc:creator>
      <dc:date>2022-03-14T12:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to open an auto cad file drawing and select all (whatever obj are in the drawing) in c#?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-an-auto-cad-file-drawing-and-select-all-whatever-obj/m-p/11004110#M13411</link>
      <description>&lt;P&gt;Opening a drawing:&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/OARX/2022/ENU/?guid=GUID-330A8DCB-626F-4271-8B89-9773A7631D87" target="_blank" rel="noopener"&gt;https://help.autodesk.com/view/OARX/2022/ENU/?guid=GUID-330A8DCB-626F-4271-8B89-9773A7631D87&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Selecting objects in a drawing:&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/OARX/2022/ENU/?guid=GUID-CBECEDCF-3B4E-4DF3-99A0-47103D10DADD" target="_blank" rel="noopener"&gt;https://help.autodesk.com/view/OARX/2022/ENU/?guid=GUID-CBECEDCF-3B4E-4DF3-99A0-47103D10DADD&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 16:23:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-an-auto-cad-file-drawing-and-select-all-whatever-obj/m-p/11004110#M13411</guid>
      <dc:creator>R.Gerritsen4967</dc:creator>
      <dc:date>2022-03-14T16:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to open an auto cad file drawing and select all (whatever obj are in the drawing) in c#?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-open-an-auto-cad-file-drawing-and-select-all-whatever-obj/m-p/11005461#M13412</link>
      <description>&lt;P&gt;Actually iam new to this autocad .net api&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you tell me below code is right ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public void Method()&lt;BR /&gt;{&lt;BR /&gt;string strFileName = "C:\\Users\\Desktop\\api.dwg";&lt;BR /&gt;DocumentCollection DocMgr = Application.DocumentManager;&lt;BR /&gt;Document Doc = DocMgr.CurrentDocument;&lt;BR /&gt;Database db = Doc.Database;&lt;BR /&gt;Editor ed = Doc.Editor;&lt;BR /&gt;if (File.Exists(strFileName))&lt;BR /&gt;{&lt;BR /&gt;DocMgr.Open(strFileName, false);&lt;BR /&gt;{&lt;BR /&gt;db.ReadDwgFile(strFileName, FileOpenMode.OpenForReadAndWriteNoShare, false, null);&lt;BR /&gt;using (Transaction tr = db.TransactionManager.StartTransaction())&lt;BR /&gt;{&lt;BR /&gt;//create a selection set and select all objects in drawing&lt;BR /&gt;PromptSelectionResult psr = ed.SelectAll();&lt;BR /&gt;SelectionSet ss = psr.Value;&lt;BR /&gt;if (psr.Status==PromptStatus.OK) //if the object is selected&lt;BR /&gt;{&lt;BR /&gt;foreach(SelectedObject sObj in ss)&lt;BR /&gt;{&lt;BR /&gt;if (sObj != null)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;DocMgr.MdiActiveDocument.Editor.WriteMessage("File " + strFileName +&lt;BR /&gt;" does not exist.");&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 06:58:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-open-an-auto-cad-file-drawing-and-select-all-whatever-obj/m-p/11005461#M13412</guid>
      <dc:creator>AmanKumar1</dc:creator>
      <dc:date>2022-03-15T06:58:59Z</dc:date>
    </item>
  </channel>
</rss>

