HOW TO

Use a polygon as a FilterShape

Last Published: April 25, 2020

Summary

A variant of type IUnknown must be used as a FilterShape in some development environments.

Procedure



In Delphi:

Code:
vaPoly := OleVariant(filterShape);
layer.FilterOperator := moAreaIntersect;
layer.FilterShape := IUnknown(vaPoly);

In Visual C++:

Code:
VARIANT vShape;
VariantInit(&vShape);
vShape.vt = VT_UNKNOWN;
vShape.punkVal = filterShp.m_lpDispatch;

layer.SetFilterOperator(moAreaIntersect);
layer.SetFilterShape(vShape);


In Visual Basic simply write the shape into the FilterShape property.

Code:
layer.FilterOperator = moAreaIntersect
Set lyr.FilterShape = shp

Article ID:000005341

Software:
  • Legacy Products

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options