<?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 check if selection set is null in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-to-check-if-selection-set-is-null/m-p/2660154#M66122</link>
    <description>how do you check if selection set is null? this is my code. it doesnt work... lol&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
            Dim myDWG As ApplicationServices.Document&lt;BR /&gt;
            Dim myDB As DatabaseServices.Database&lt;BR /&gt;
            Dim myEd As EditorInput.Editor&lt;BR /&gt;
            Dim myPSR As EditorInput.PromptSelectionResult&lt;BR /&gt;
            Dim mySS As EditorInput.SelectionSet&lt;BR /&gt;
            Dim myFilter(0) As DatabaseServices.TypedValue&lt;BR /&gt;
            myFilter(0) = New DatabaseServices.TypedValue(DatabaseServices.DxfCode.BlockName, "aaa")&lt;BR /&gt;
            Dim mySF As New EditorInput.SelectionFilter(myFilter)&lt;BR /&gt;
            myDWG = ApplicationServices.Application.DocumentManager.MdiActiveDocument&lt;BR /&gt;
            myDB = myDWG.Database&lt;BR /&gt;
            myEd = myDWG.Editor&lt;BR /&gt;
            myPSR = myEd.SelectAll(mySF)&lt;BR /&gt;
            mySS = myPSR.Value&lt;BR /&gt;
&lt;BR /&gt;
---&amp;gt; this line is messed up, how do you fix this? im getting error if selectionset is empty...&lt;BR /&gt;
            If mySS &amp;lt;&amp;gt; Nothing Then&lt;BR /&gt;
                MsgBox(mySS.Count)&lt;BR /&gt;
            End If&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks....</description>
    <pubDate>Fri, 02 Apr 2010 21:46:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-04-02T21:46:19Z</dc:date>
    <item>
      <title>how to check if selection set is null</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-check-if-selection-set-is-null/m-p/2660154#M66122</link>
      <description>how do you check if selection set is null? this is my code. it doesnt work... lol&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
            Dim myDWG As ApplicationServices.Document&lt;BR /&gt;
            Dim myDB As DatabaseServices.Database&lt;BR /&gt;
            Dim myEd As EditorInput.Editor&lt;BR /&gt;
            Dim myPSR As EditorInput.PromptSelectionResult&lt;BR /&gt;
            Dim mySS As EditorInput.SelectionSet&lt;BR /&gt;
            Dim myFilter(0) As DatabaseServices.TypedValue&lt;BR /&gt;
            myFilter(0) = New DatabaseServices.TypedValue(DatabaseServices.DxfCode.BlockName, "aaa")&lt;BR /&gt;
            Dim mySF As New EditorInput.SelectionFilter(myFilter)&lt;BR /&gt;
            myDWG = ApplicationServices.Application.DocumentManager.MdiActiveDocument&lt;BR /&gt;
            myDB = myDWG.Database&lt;BR /&gt;
            myEd = myDWG.Editor&lt;BR /&gt;
            myPSR = myEd.SelectAll(mySF)&lt;BR /&gt;
            mySS = myPSR.Value&lt;BR /&gt;
&lt;BR /&gt;
---&amp;gt; this line is messed up, how do you fix this? im getting error if selectionset is empty...&lt;BR /&gt;
            If mySS &amp;lt;&amp;gt; Nothing Then&lt;BR /&gt;
                MsgBox(mySS.Count)&lt;BR /&gt;
            End If&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks....</description>
      <pubDate>Fri, 02 Apr 2010 21:46:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-check-if-selection-set-is-null/m-p/2660154#M66122</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-02T21:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to check if selection set is null</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-check-if-selection-set-is-null/m-p/2660155#M66123</link>
      <description>&lt;A7V1N&gt; wrote in message news:6366478@discussion.autodesk.com...&lt;BR /&gt;
how do you check if selection set is null? this is my code. it doesnt &lt;BR /&gt;
work... lol&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
---&amp;gt; this line is messed up, how do you fix this? im getting error if &lt;BR /&gt;
selectionset is empty...&lt;BR /&gt;
            If mySS &amp;lt;&amp;gt; Nothing Then&lt;BR /&gt;
                MsgBox(mySS.Count)&lt;BR /&gt;
            End If&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
i have not enter you code, but just looking at its end gives me an idea that &lt;BR /&gt;
you could try with:&lt;BR /&gt;
&lt;BR /&gt;
If NOT myss IS nothing then&lt;BR /&gt;
    msgbox(myss.count)&lt;BR /&gt;
end if&lt;BR /&gt;
&lt;BR /&gt;
tell us did it worked that way?&lt;BR /&gt;
i dont know if it can be not nothing but be 0?&lt;BR /&gt;
if that is possable, then in that case there should be need to check that &lt;BR /&gt;
also&lt;/A7V1N&gt;</description>
      <pubDate>Sun, 04 Apr 2010 13:15:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-check-if-selection-set-is-null/m-p/2660155#M66123</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-04T13:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to check if selection set is null</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-check-if-selection-set-is-null/m-p/2660156#M66124</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
'If NOT myss IS nothing then' is quite ugly...&lt;BR /&gt;
&lt;BR /&gt;
Look at the Status property of PromptSelectionResult&lt;BR /&gt;
&lt;BR /&gt;
a little C# sample:&lt;BR /&gt;
{code}Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;&lt;BR /&gt;
PromptSelectionResult psr = ed.GetSelection();&lt;BR /&gt;
if (psr.Status == PromptStatus.OK)&lt;BR /&gt;
    Application.ShowAlertDialog(string.Format("{0} selected objects", psr.Value.GetObjectIds().Length));{code}</description>
      <pubDate>Sun, 04 Apr 2010 14:21:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-check-if-selection-set-is-null/m-p/2660156#M66124</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2010-04-04T14:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to check if selection set is null</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-check-if-selection-set-is-null/m-p/2660157#M66125</link>
      <description>'If NOT myss IS nothing then' is quite ugly...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
that is nicely noticed&lt;BR /&gt;
my eyes just got glued to his direct question :" If mySS &amp;lt;&amp;gt; Nothing Then"&lt;BR /&gt;
so i fail to see bigger picture :))</description>
      <pubDate>Sun, 04 Apr 2010 15:51:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-check-if-selection-set-is-null/m-p/2660157#M66125</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-04T15:51:37Z</dc:date>
    </item>
  </channel>
</rss>

