Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Has anyone had any success of repairing disconnected layers that have selection sets that have their data sources broken in ArcGIS? Is there a way to detect this through code and then re-create that selection set?

I tried:

IFeatureLayerDefinition.DefinitionSelectionSet.Count

and

IFeatureSelection.SelectionSet.Count

of which just give an "Object reference not set to an instance of an object" error.

We are on version 10.0 and code in VB.NET or C#.

Thanks

Rob

share|improve this question
    
do you mean repairing layers which have data sources broken? –  vinayan May 18 '12 at 15:06
    
yes - layers that have data sources broken –  Rob May 19 '12 at 15:39
    
Did you check the ILayer.Valid property? –  blah238 May 21 '12 at 9:33
    
Blah238 - someone annoyingly edited my question and removed the specifics of what I was asking. ILayer.Valid will tell you if the layer is not valid but of course it won't tell you if the layer had a selection set before it become disconnected. I'm specifically talking about selection sets. –  Rob May 21 '12 at 19:53
1  
@blah238: The OID list does get persisted in the map document, you just can't access it once the layer is not connected. I also believe that on SDE, large (> 200 rows) selection sets get persisted to the database. Not sure they are saved in the MXD in that case as well. –  Petr Krebs May 22 '12 at 15:05
show 5 more comments

1 Answer

up vote 0 down vote accepted

Seems to be no answer for this except to try to repath before you move data. Then before changing the path record the oids of the selection set and I've re-applied as a definition query instead or create a new layer with a selection set.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.