In using arcpy, I have found that there are just a few lines of code needed to get a list of layers in a LYR file if more than one layer exist. How can I accomplish this same feat using ArcObjects in C#? I know that ILayerFile is the way to start this off and I can open a specific layer file using ILayerFile.Open() but how can I get back a list of layers in this layer file if more than one exist?
Tell me more
×
Geographic Information Systems Stack Exchange is a question and answer site for
cartographers, geographers and GIS professionals. It's 100% free, no registration required.
|
|
Query interface from If the QI succeded, check e.g.:
You can then access a sublayer by its index (probably using a for loop) using the If you think the layer file might have multiple nested group layers, you would want to write a recursive function to loop through each sublayer and recurse if it is also a composite layer or do something else with it if not. |
||||
|
|
