How to use an arry for buffer

المشرف العام

Administrator
طاقم الإدارة
I want to to use an arry to create 3 buffer files with different buffer distances. So that the code should produce 3 buffer files in one step. The code below runs already after used an Arcgis Add-in but I have no imagination how to build in the arry and to save this 3 different buffer files.

Can somebody point me please 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 arry:

Imports ESRI.ArcGIS.GeoprocessorImports ESRI.ArcGIS.FrameworkImports ESRI.ArcGIS.CartoImports ESRI.ArcGIS.ArcMapUIImports ESRI.ArcGIS.AnalysisToolsPublic 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 SubEnd Class

أكثر...
 
أعلى