<?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: selection set error in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/selection-set-error/m-p/10947728#M13659</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;totalset is a SelectionSet.&lt;/P&gt;
&lt;P&gt;A SelectionSet contains SelectedObject items not Entity items.&lt;/P&gt;</description>
    <pubDate>Sun, 13 Feb 2022 17:00:48 GMT</pubDate>
    <dc:creator>_gile</dc:creator>
    <dc:date>2022-02-13T17:00:48Z</dc:date>
    <item>
      <title>selection set error</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-set-error/m-p/10947701#M13658</link>
      <description>&lt;P&gt;Im facing another problem too&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;line 289 shoots an error&lt;/P&gt;&lt;P&gt;in the exception user-Unhandled box it says this:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Name Value Type&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;▶&lt;/TD&gt;&lt;TD&gt;$exception&lt;/TD&gt;&lt;TD&gt;{"Unable to cast object of type 'Autodesk.AutoCAD.EditorInput.SelectedObject' to type 'Autodesk.AutoCAD.DatabaseServices.Entity'."}&lt;/TD&gt;&lt;TD&gt;System.InvalidCastException&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;whats strange is I used the same method a few lines above which is not included in the screen shot.&lt;/P&gt;&lt;P&gt;this is what i wrote and passed it without error:&lt;/P&gt;&lt;P&gt;PromptSelectionResult psr2 = ed.SelectAll();&lt;BR /&gt;if (psr2.Status==PromptStatus.OK)&lt;BR /&gt;{&lt;BR /&gt;SelectionSet selall = psr2.Value;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="code.JPG" style="width: 821px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1024582i8663379E1DA3EA02/image-size/large?v=v2&amp;amp;px=999" role="button" title="code.JPG" alt="code.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;I also noticed my code wont hide entities:&lt;/P&gt;&lt;P&gt;foreach (ObjectId obj in objallID)&lt;BR /&gt;{&lt;BR /&gt;Entity ent = trs.GetObject(obj, OpenMode.ForWrite) as Entity;&lt;BR /&gt;ent.Visible=false;&lt;BR /&gt;}&lt;BR /&gt;Autodesk.AutoCAD.Internal.Utils.FlushGraphics();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/543921"&gt;@norman.yuan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Feb 2022 16:45:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-set-error/m-p/10947701#M13658</guid>
      <dc:creator>a.kouchakzadeh</dc:creator>
      <dc:date>2022-02-13T16:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: selection set error</title>
      <link>https://forums.autodesk.com/t5/net-forum/selection-set-error/m-p/10947728#M13659</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;totalset is a SelectionSet.&lt;/P&gt;
&lt;P&gt;A SelectionSet contains SelectedObject items not Entity items.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Feb 2022 17:00:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/selection-set-error/m-p/10947728#M13659</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2022-02-13T17:00:48Z</dc:date>
    </item>
  </channel>
</rss>

