AnsweredAssumed Answered

Clipfilter from ImapClipOptions doesn't work

Question asked by gis@sit-puglia.it on Oct 14, 2016

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

Outcomes