Infrastructure Map Server Forum
Welcome to Autodesk’s Infrastructure Map Server Forums. Share your knowledge, ask questions, and explore popular Infrastructure Map Server topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Map selection details in MGOS 2.1

2 REPLIES 2
Reply
Message 1 of 3
siva4autodesk
840 Views, 2 Replies

Map selection details in MGOS 2.1

Hi,


i am not able to get the selection details in MGOS 2.1 earlier i used 2.0 its working fine but in 2.1 its not comming see the below code

2.0

// TODO: How to get selectionSize?
int selectionSize = 20;
MgStringCollection filters = sel.GenerateFilters(selLayer, featureClassName, selectionSize);

int numFilter = filters.GetCount();
for (int filterIndex = 0; filterIndex < numFilter; filterIndex++)
{
String filter = filters.GetItem(filterIndex);
if (filter == null || filter.Length == 0)
continue;

strReturn = featureClassName + "@" + filter;
}

in 2.1

String filter = sel.GenerateFilter(selLayer, featureClassName);


its return null...



Thanks & Regards
Siva
2 REPLIES 2
Message 2 of 3
sakkaku
in reply to: siva4autodesk

It is working fine for us, but we are doing something like this:

selection.GenerateFilter(layer, layer.GetFeatureClassName())
Edited by: sakkaku on Feb 3, 2010 12:48 PM
Message 3 of 3

Hi,

Thanks for reply, but i am not getting the id value,
like i am using


{code}

MgUserInformation cred = new MgUserInformation(HttpContext.Current.Session[AppConfigs.GetValue(DSSDISessions.MAPSESSION)].ToString());

//connect to the site and get a feature service and a resource service instances
MgSiteConnection site = new MgSiteConnection();
site.Open(cred);
MgFeatureService featureSrvc = site.CreateService(MgServiceType.FeatureService) as MgFeatureService;
MgResourceService resourceSrvc = site.CreateService(MgServiceType.ResourceService) as MgResourceService;


//load the map runtime state
//
MgMap map = new MgMap();
map.Open(resourceSrvc, HttpContext.Current.Session[AppConfigs.GetValue(DSSDISessions.MAPNAME)].ToString());

//locate the buffer layer in the map. It might or might not already exist
//
MgLayerCollection layers = map.GetLayers();

string selText = selectionXML;
MgSelection sel = new MgSelection(map, selText);
MgReadOnlyLayerCollection selLayers = sel.GetLayers();

MgLayer selLayer = (MgLayer)selLayers.GetItem(0);
String selLayerName = selLayer.GetName();
String featureClassName = selLayer.GetFeatureClassName();

// TODO: How to get selectionSize?
//int selectionSize = 20;
//MgStringCollection filters = sel.GenerateFilters(selLayer, featureClassName, selectionSize);

//int numFilter = filters.GetCount();
//for (int filterIndex = 0; filterIndex < numFilter; filterIndex++)
//{
// String filter = filters.GetItem(filterIndex);
// if (filter == null || filter.Length == 0)
// continue;

// strReturn = featureClassName + "@" + filter;
//}


String filter = sel.GenerateFilter(selLayer, featureClassName);

strReturn = featureClassName + "@" + filter;

{code}

Edited by: siva4autodesk on Feb 4, 2010 11:32 AM Edited by: siva4autodesk on Feb 4, 2010 11:32 AM

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report