I want to to use an array to create 3 buffer files with different buffer distances. The code should produce 3 buffer files in one step. Additionally, the code below runs already after using an ArcGIS Add-in, but I have no idea on how to build in the array and to save this 3 different buffer files.
Can somebody please point me in right direction, as I have no idea where to start? My system is ArcGIS10.2, VB.net, Visual Studio2012
Here is the code without array:
Imports ESRI.ArcGIS.Geoprocessor Imports ESRI.ArcGIS.Framework Imports ESRI.ArcGIS.Carto Imports ESRI.ArcGIS.ArcMapUI Imports ESRI.ArcGIS.AnalysisTools Public Class BufferButton1 Inherits ESRI.ArcGIS.Desktop.AddIns.Button Public Sub New() End Sub Protected Overrides Sub OnClick() Dim m_application = My.ArcMap.Application Dim mxDocument As IMxDocument = m_application.Document Dim map As IMap = mxDocument.FocusMap Dim strInputFC As String Dim strOutputFC As String Dim intOutputBufferSize As Integer Dim gp As ESRI.ArcGIS.Geoprocessor.Geoprocessor = New ESRI.ArcGIS.Geoprocessor.Geoprocessor() gp.OverwriteOutput = 1 strInputFC = map.Layer(0).Name strOutputFC = "E:\" ' in this path I would like to save the 3 buffer files intOutputBufferSize = 1000 ' here I would like to handle three buffer sizes eg 1000, 2000 and 3000 Dim bufferTool As ESRI.ArcGIS.AnalysisTools.Buffer = New ESRI.ArcGIS.AnalysisTools.Buffer() bufferTool.in_features = strInputFC bufferTool.out_feature_class = strOutputFC bufferTool.buffer_distance_or_field = intOutputBufferSize gp.Execute(bufferTool, Nothing) My.ArcMap.Application.CurrentTool = Nothing End Sub Protected Overrides Sub OnUpdate() Enabled = My.ArcMap.Application IsNot Nothing End Sub End Class