olamr

BasicGeoprocessor.Clip parameter bug?

Discussion created by olamr on May 18, 2011
Hi all,
I am developing a ArcMap 9.3.1 extension i DotNet. (VS2008)

Using a polygon featureclass to clip data from a line featureclass and placing the result in a shapefile, works fine.
BUT: If there are several polygons in the clipping featureclass, then every polygon is used in the clipping operation, no matter what parameters I use, or if a polygon is selected in advance.
See code below.
Have I been missing something? Is this supposed to work?


IFeatureClass fcPolygons = ...
// One polygon is selected in advance.
IFeatureClass fcLines = ...
WorkspaceNameClass wsNameObj = new WorkspaceNameClass();
wsNameObj.WorkspaceFactoryProgID = "esriDataSourcesFile.ShapefileWorkspaceFactory";
wsNameObj.PathName = "C:\\Temp";
//
// Create the result dataset name object:
IDatasetName outputNameObject = new FeatureClassNameClass();
outputNameObject.Name = "test.shp";
outputNameObject.WorkspaceName = wsNameObj;
//
// Perform clipping:
ITable tblLines = (ITable)fcLines;
ITable tblPolygons = (ITable)fcPolygons;
double tolerance = 0.0;
bool useSelectedLines = false;
bool useSelectedPolygons = true;
ESRI.ArcGIS.Carto.IBasicGeoprocessor gp = new ESRI.ArcGIS.Carto.BasicGeoprocessor();
IFeatureClass fcOutput = gp.Clip(tblLines, useSelectedLines, tblPolygons, useSelectedPolygons, tolerance, (IFeatureClassName)outputNameObject);

Outcomes