<?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: Check if AutoCAD selection set contains FDO features? in AutoCAD Map 3D Developer Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/check-if-autocad-selection-set-contains-fdo-features/m-p/3610808#M1958</link>
    <description>&lt;P&gt;Hi Jackie,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;many thanks - that's the solution,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;</description>
    <pubDate>Fri, 07 Sep 2012 12:12:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-09-07T12:12:04Z</dc:date>
    <item>
      <title>Check if AutoCAD selection set contains FDO features?</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/check-if-autocad-selection-set-contains-fdo-features/m-p/3607784#M1955</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there a reliable way to check if selected objects are Map FDO features?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems no checking is done here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://adndevblog.typepad.com/infrastructure/2012/07/using-acmapfeatureentityservicegetselection-to-access-fdo-feature-data.html" target="_blank"&gt;http://adndevblog.typepad.com/infrastructure/2012/07/using-acmapfeatureentityservicegetselection-to-access-fdo-feature-data.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but checking is done here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/AutoCAD-Map-3D-Developer/FDO-object-properties-through-GetEntity/td-p/3080204" target="_blank"&gt;http://forums.autodesk.com/t5/AutoCAD-Map-3D-Developer/FDO-object-properties-through-GetEntity/td-p/3080204&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which I haven't tried myself yet but it doesn't look right to me to rely on this construct:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (ent.Layer!="*ACMAPDMGISENTITIES") ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I have is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;MgSelectionBase selectionBase = AcMapFeatureEntityService.GetSelection(selSet);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I need to filter out all non-FDO objects in "selSet". Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;many thanks,&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Sep 2012 12:49:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/check-if-autocad-selection-set-contains-fdo-features/m-p/3607784#M1955</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-09-05T12:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Check if AutoCAD selection set contains FDO features?</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/check-if-autocad-selection-set-contains-fdo-features/m-p/3607940#M1956</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my issue is actually slighty different then described above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For me it doesn't matter if there are FDO and CAD objects mixed in the selection set. The problem arises if only CAD objects have been selected. I need to find out if that is the case. But I do not know how.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If only an ACAD object has been selected I get a System.NullReferenceException. So I added a check whether the object in question is null or not. But it doesn't seem to be null or my check is wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;MgSelectionBase selectionBase = AcMapFeatureEntityService.GetSelection(selSet);

if (selectionBase != null)

...//ok

else

 return; //stop

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It never follows the Else branch - but then I get the aformentioned exception later on at&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;selectionBase.GetLayers().Count

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Sep 2012 14:04:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/check-if-autocad-selection-set-contains-fdo-features/m-p/3607940#M1956</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-09-05T14:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Check if AutoCAD selection set contains FDO features?</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/check-if-autocad-selection-set-contains-fdo-features/m-p/3610414#M1957</link>
      <description>&lt;P&gt;Unless AutoCAD Map has a radically different implementation of MgSelectionBase from MapGuide, the GetLayers() method of MgSelectionBase returns null for empty selections&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So selectionBase.GetLayers() == null means no features selected&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Jackie&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2012 03:39:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/check-if-autocad-selection-set-contains-fdo-features/m-p/3610414#M1957</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-09-07T03:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Check if AutoCAD selection set contains FDO features?</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/check-if-autocad-selection-set-contains-fdo-features/m-p/3610808#M1958</link>
      <description>&lt;P&gt;Hi Jackie,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;many thanks - that's the solution,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2012 12:12:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/check-if-autocad-selection-set-contains-fdo-features/m-p/3610808#M1958</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-09-07T12:12:04Z</dc:date>
    </item>
  </channel>
</rss>

