合并要素--how to use ConstructUnion
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                合并要素--how to use ConstructUnion
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                合并要素--how to use "ConstructUnion"
?
?參考:http://forums.esri.com/Thread.asp?c=93&f=1170&t=80838
?
?The following VBA macro creates a graphic element that is the union of all selected polygons in the map. The union is constructed using a geometry bag. 
?
?
Sub UnionFeatures()Dim pMxDoc As IMxDocument
Dim pEnumFeature As IEnumFeature
Dim pFeature As IFeature
Dim pGeoBag As IGeometryBag
Dim pGeoCollection As IGeometryCollection
Dim pTopoOp As ITopologicalOperator2
Dim pPolygon As IPolygon
Dim pPolygonElement As IPolygonElement
Dim pElement As IElement
Dim pGC As IGraphicsContainer
Set pMxDoc = ThisDocument
Set pEnumFeature = pMxDoc.FocusMap.FeatureSelection
pEnumFeature.Reset
Set pGeoBag = New GeometryBag
Set pGeoCollection = pGeoBag
Set pFeature = pEnumFeature.Next
Do While Not pFeature Is Nothing
If pFeature.Shape.GeometryType = esriGeometryPolygon Then
Set pTopoOp = pFeature.ShapeCopy
pTopoOp.IsKnownSimple = False
pTopoOp.Simplify
pGeoCollection.AddGeometry pTopoOp
End If
Set pFeature = pEnumFeature.Next
Loop
Set pTopoOp = New Polygon
pTopoOp.ConstructUnion pGeoBag
Set pPolygon = pTopoOp
Set pGC = pMxDoc.FocusMap
Set pPolygonElement = New PolygonElement
Set pElement = pPolygonElement
pElement.Geometry = pPolygon
pGC.AddElement pElement, 0
pMxDoc.ActiveView.Refresh
End Sub
?
轉載于:https://www.cnblogs.com/lauer0246/archive/2008/09/09/1287401.html
總結
以上是生活随笔為你收集整理的合并要素--how to use ConstructUnion的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: 计算机Java程序设计标准讲义
- 下一篇: [ SAP ASAP ] SAP ASA
