Snap Geoprocessing in Arcobjects

1943
1
Jump to solution
02-12-2016 03:04 AM
NigelDsouza
Occasional Contributor

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

0 Kudos
1 Solution

Accepted Solutions
NigelDsouza
Occasional Contributor

Got it. I had to use a IGpValueTableObject in the snap_environment parameter.

View solution in original post

0 Kudos
1 Reply
NigelDsouza
Occasional Contributor

Got it. I had to use a IGpValueTableObject in the snap_environment parameter.

0 Kudos