Transferred from the original language using C # and AE call GP tools
First, it is necessary to identify what tools you need to call arctoolbox and what functions to implement. Third, write command or tool tools and write your own functional tools.
1) Create a project first. 3) define the name of the tool and other information
PublicKriging () {Base. M_category ="Gptools"; Base. m_caption ="Krugin interpolation"; Base. M_message ="Krugin interpolation"; Base. M_tooltip ="Krugin interpolation"; Base. M_name ="Kriging"; Try { stringBitmapresourcename = GetType (). Name +". bmp"; Base. M_bitmap =NewBitmap (GetType (), bitmapresourcename); } Catch(Exception ex) {System.Diagnostics.Trace.WriteLine (ex). Message,"Invalid Bitmap"); }} Public Override voidOnClick () {geoprocessor GP=Newgeoprocessor (); ESRI. ArcGIS.Analyst3DTools.Kriging pkriging=NewKriging (); Pkriging.in_point_features=@"e:\ sea level pressure. SHP"; Pkriging.z_field="PSLV"; Pkriging.out_surface_raster=@"e:\\krigingnew"; Pkriging.semivariogram_props="Spherical"; Gp. Execute (pkriging,NULL);}5Run the program, call it in ArcMap and try it, and it's quite successful. As follows: The extraction tool can also call the GP tool, the code is as follows: Geoprocessor GP=Newgeoprocessor (); ESRI. ArcGIS.SpatialAnalystTools.ExtractByMask Pextractbymask=Newpextractbymask ();p extractbymask.in_raster=@"C:\map\grid\dqjsl";p Extractbymask.in_mask_data=@"C:\map\XZJQ_ShiJi_R";p Extractbymask.out_raster=@"C:\map\clipresult"; Commonclass.runtool (GP, Pextractbymask,NULL);
6) Other methods to call GP tools are similar, very convenient method.
Using C # and AE to call GP tools