ArcObjects: How to enable associating levels to masked layers?

619
1
07-28-2017 11:35 AM
mikebaran
New Contributor

In the advanced drawing options for Layers there is a checkbox 'Enable to associate levels to masked layers'. I'm trying to figure out how to enable this via ArcObjects. I can cast an IMap or IGroupLayer to ILevelMasking to retrieve the levels as a string, but nothing in that interface allows me to enable the option. Any ideas?

0 Kudos
1 Reply
mikebaran
New Contributor

Figured it out. Seems it's derived if you have a few things set properly:
1. Make sure Draw using masking options specified below is enabled (Cast your IMap to ILayerMasking and set UseMasking to true.)
2. Ensure the layer you're trying to add a masked level to is checked as a masking layer (cast your IMap or the IGroupLayer your ILayer belongs to to an ILayerMasking object, and then use ILayerMasking.set_MaskingLayers to set the list of masking layers. Note the list is an ESRI.ArcGIS.esriSystem.ISet).
3. Set the level masking by casting your IMap to IGroupLayer your layer belongs to using ILevelMasking and using ILevelMasking.set_LevelMasking(MaskedLayer, MaskingLayer, "1234") where "1234" is the strong for your level masking value.)

0 Kudos