' Get handle input point layer Dim pmap As IMap pmap = My.ArcMap.Document.FocusMap Dim pLayer As ILayer pLayer = pmap.Layer(0) Dim pFeatureLayer As IFeatureLayer pFeatureLayer = pLayer ' Run geoprocessing tool Try ' Create Minimum bounding geometry tool Dim mbg = New ESRI.ArcGIS.DataManagementTools.MinimumBoundingGeometry() With mbg .geometry_type = "convex_hull" .in_features = pFeatureLayer .out_feature_class = "c:\temp\conhull.shp" End With ' Cast as a GPProcess Dim pGPProcess As ESRI.ArcGIS.Geoprocessor.IGPProcess pGPProcess = mbg ' Create GeoProcessor Dim GP As New ESRI.ArcGIS.Geoprocessor.Geoprocessor GP.OverwriteOutput = True GP.AddOutputsToMap = True ' Execute tool Dim pResult As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2 pResult = GP.Execute(pGPProcess, Nothing) Catch ex As Exception MsgBox(ex.Message) End Try MsgBox("finished!")
The CONVEX_HULL, CIRCLE, and ENVELOPE options are only available with an ArcInfo license.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.