AnsweredAssumed Answered arcobjects run Geoprocessing tool with optional parameter

Question asked by littleleaf on Sep 23, 2014
Latest reply on Sep 24, 2014 by littleleaf

Dear all,


I am using arcobjects to run the intersect geoprocessing tool. When I use all the required parameters, it works. But if I add an optional parameter, it not work.


My code is as bellows:


Dim GP As GeoProcessor = New GeoProcessor()

Dim parameters As IVariantArray = New VarArray




parameters.Add("0.5 Meters")  ' this is an optional parameter for XY tolerance

"Intersect_Analysis", parameters, Nothing)


When I add the parameter of XY tolerance, it will cause error. I wonder is anything missing in my code? Thanks!