ArcMapAddinVisibility.ViewModels.RLOSViewModel.SetGPMask C# (CSharp) Method

SetGPMask() private method

Set a mask on the gp object to buffer the output to the specified distance
private SetGPMask ( IFeatureWorkspace workspace, List geomList, IGeoProcessor2 gp, string fcName ) : string
workspace IFeatureWorkspace IFeatureWorkspace
geomList List List of geometries to create the mask
gp IGeoProcessor2 IGeoProcessor2
fcName string
return string
        private string SetGPMask(IFeatureWorkspace workspace, List<IGeometry> geomList, IGeoProcessor2 gp, string fcName)
        {
            IFeatureClass maskFc = CreateMaskFeatureClass(workspace, fcName + "_" + RunCount.ToString());

            foreach (IGeometry geom in geomList)
            {
                //create a new point feature
                IFeature ipFeature = maskFc.CreateFeature();
                ipFeature.Shape = geom;
                ipFeature.Store();
            }
            IDataset ds = (IDataset)maskFc;
            string path = ds.Workspace.PathName + "\\" + ds.BrowseName;
            gp.SetEnvironmentValue("mask", path);

            return path;
        }