AcMapFeatureEntityService class in Autodesk.Gis.Map.Platform.Interop namespace has a function GetSelection(SelectionSet acadSel) which takes a AutoCAD SelectionSet object. Here is an example command implemented in C# that gets all the features in the pick first set and output the unique ID for each of the selected FDO features.
[CommandMethod("FDOSel", CommandFlags.UsePickSet)]
public void FDOFeatureSelectionTest()
{
PromptSelectionResult res = ed.SelectImplied();
if (res.Status.Equals(PromptStatus.OK))
{
AcMapSelection sel = (AcMapSelection)AcMapFeatureEntityService.GetSelection(res.Value);
AcMapMap currentMap = AcMapMap.GetCurrentMap();
MgLayerCollection layers = currentMap.GetLayers();
foreach (MgLayerBase lyr in layers)
{
ed.WriteMessage("\nSelected Count(" + lyr.Name + "): " + sel.GetSelectedFeaturesCount(lyr, lyr.FeatureClassName));
MgFeatureReader reader = sel.GetSelectedFeatures(lyr, lyr.FeatureClassName, false);
while (reader.ReadNext())
{
// Tested with sample sdf data C:\Program Files\Autodesk\AutoCAD Map 3D 2013\Sample\Maps\SDF\buildings.sdf
// in the data set, there is a column named PRIMARYINDEX
ed.WriteMessage("\nPRIMARYINDEX: " + reader.GetInt32("PRIMARYINDEX"));
}
}
}
}
Hope this is useful to you!
