If you are looking for a way to access the FDO features and read the feature attributes in Map 3D using Geospatial Platform API, then the following C#.NET code snippet might be useful to you. This code snippet shows how to use the Geospatial Platform API in AutoCAD Map 3D and access the FDO Features.
// Get the Map Object
AcMapMap currentMap = AcMapMap.GetCurrentMap();
// Prompt user to Select Feature in Map
PromptSelectionOptions psop = new PromptSelectionOptions();
psop.MessageForAdding = "Select the FDO Feature in Map 3D to read Data : ";
psop.SingleOnly = true;
PromptSelectionResult psResult = ed.GetSelection(psop);
if (psResult.Status == PromptStatus.OK)
{
SelectionSet selSet = psResult.Value;
// Get Map Selectionset from AutoCAD SelectionSet
MgSelectionBase mapSelBase = AcMapFeatureEntityService.GetSelection(selSet);
AcMapLayer mapLayer = AcMapFeatureEntityService.GetLayer(psResult.Value[0].ObjectId);
//Get the ID of the selected Parcel
MgFeatureReader ftrRdr = mapSelBase.GetSelectedFeatures(mapLayer, mapLayer.FeatureClassName, false);
while (ftrRdr.ReadNext())
{
MgClassDefinition cd = ftrRdr.GetClassDefinition();
//this is just an example; change this according to your FDO data field
String ownerName = ftrRdr.GetString("STNAME");
ed.WriteMessage("\n Parcel Owner Name :" + ownerName.ToString());
}
}
trans.Commit();