AnsweredAssumed Answered

Snap Geoprocessing in Arcobjects

Question asked by nigel_ngl2 on Feb 12, 2016
Latest reply on Feb 14, 2016 by nigel_ngl2

Hi,

 

I wish to execute the snap geoprocessing tool from the editing tools toolbox,

However I am having trouble passing in the parameters for the snap_environment parameter.

 

Here is my code:

               Geoprocessor pGp = new Geoprocessor();

             Snap pSnapTool = new Snap();

               pSnapTool.in_features = pInputFeaturClass.AliasName;

               IArray snap_environment = new ArrayClass();

 

               IVariantArray snap_paramters = new VarArrayClass();

 

 

               IVariantArray parameters = new VarArrayClass();

               parameters.Add(pWorskpace.PathName + "\\" + pSourceFeaturClass.AliasName);

               parameters.Add("EDGE");

               parameters.Add("50 Meters");

 

               snap_environment.Add(parameters );

 

               pSnapTool.snap_environment = snap_environment;

               pGp.Execute(pSnapTool, null);

 

 

Can anyone provide the correct syntax?

Regards,

Nigel

Outcomes