怎么用mapx中BufferFeatures创建缓冲区,我需要代码

来源:百度知道 编辑:UC知道 时间:2024/05/18 00:27:58

Description:

This sample buffers each selected feature in the focus map and stores the results as polygon graphic elements in the map's basic graphics layer. Products:

ArcView: VBA

Platforms: Windows

Minimum ArcGIS Release: 9.0

How to use:

Paste the code into VBA.

Load one or more feature layers.

Select some features.

From the Macros dialog, run the BufferFeatures macro.

Public Sub BufferFeatures() Dim pMxDoc As IMxDocument Dim pActiveView As IActiveView Dim pGraphicsContainer As IGraphicsContainer Dim pEnumFeature As IEnumFeature Dim pFeature As IFeature Dim pTopoOp As ITopologicalOperator Dim pElement As IElement Dim strBufferDistance As String Set pMxDoc = Application.Document Set pActiveView = pMxDoc.FocusMap Set pGraphicsContainer = pMxDoc.FocusMap 'Verify there is a feature selection If pMxDoc.FocusMap.SelectionCount = 0 Then Exit Sub '