Public StaticBoolean Merge (string[] inputs,string output) {geoprocessor GP=Newgeoprocessor (); Gp. Overwriteoutput=true; intStrsize =inputs. Count (); String TempStr="\""+inputs[0]+""; for(inti =1; I < strsize-1; i++) {TempStr+=";"+ inputs[i]+""; } tempstr+=";"+ Inputs[strsize-1] +"\""; MessageBox.Show ("Input:"+tempstr); ESRI. ArcGIS.DataManagementTools.Merge Merge=NewESRI. ArcGIS.DataManagementTools.Merge (); Merge.inputs=TempStr; Merge.output=output; Try{GP. Execute (Merge,NULL); } Catch(COMException e) {stringstr =""; for(inti =0; I < GP. Messagecount; i++) {str+=GP. GetMessage (i); } MessageBox.Show (str); return false; } return true; }
The main need to pay attention to the input parameters of how to organize the problem, and the Python script inside the form of organizational parameters is a bit different!
Arcengine Call the Merge tool inside GP