Clipfilter from ImapClipOptions doesn't work

720
0
10-14-2016 08:49 AM
S_I_T__srlServizi_di_Informazi
New Contributor

Hi,

I have problem using the interface IMapClipOptions, about ClipFilter property.

I can successfully enable the clipping of a dataframe, but not excluding layers from the clipping.

Setting it manually, I can get programmatically the Layer the is in the ISet of the excluded layers, I can remove them, but I cannot set it.

I'm testing i in VBA, ArcGIS for Desktop 10.3 (Advanced).

This is the piece of code that I'm testing

Dim pDoc As IMxDocument
Dim pMap As IMap
Dim pMapClipOptions As IMapClipOptions
Dim pActiveView As IActiveView
Dim pGeometry As IGeometry
Dim pLayer As ILayer
Dim pLSet As ISet

Set pGeometry = fnvFClass_GetByName("Taglio_2K_Mask").GetFeature(173).ShapeCopy

Set pDoc = ThisDocument
Set pMap = pDoc.FocusMap

Set pMapClipOptions = pMap
Set pLayer = pMap.Layer(0)
pMapClipOptions.ClipType = esriMapClipShape
Set pLSet = New esriSystem.Set
pLSet.Add pLayer
pMapClipOptions.ClipFilter = pLSet
pMap.ClipGeometry = pGeometry

Set pActiveView = pMap
pActiveView.Refresh

The only custom code is the one used to get the geometry for the clipping.

Any idea about what could be the problem?

Thanks in advance

Francesco N. Vespucci

0 Kudos
0 Replies