El método que utilicé en uno de mis complementos fue poner todas las características en un GeometryBag y utilizar ITopologicalOperator::ConstructUnion para fusionarlo en una sola geometría. Pasé esta geometría al fragmento de FlashGeometry.
Así es como lo hice (en VB.NET). En mi caso, estaba usando un IQueryFilter para hacer la selección de características (ya sea polígonos o polilíneas) para flashear
Dim pFCursor As ESRI.ArcGIS.Geodatabase.IFeatureCursor
Dim pFeature As ESRI.ArcGIS.Geodatabase.IFeature
Dim pGeometry As ESRI.ArcGIS.Geometry.IGeometry
Dim pGeometryBag As ESRI.ArcGIS.Geometry.IGeometryCollection = New ESRI.ArcGIS.Geometry.GeometryBag
Dim pPolygon As ESRI.ArcGIS.Geometry.IPolygon
Dim pPolyline As ESRI.ArcGIS.Geometry.IPolyline
Dim pQFilter As New ESRI.ArcGIS.Geodatabase.QueryFilter
Dim pRgbColor As New ESRI.ArcGIS.Display.RgbColor
Dim pTopoOp As ESRI.ArcGIS.Geometry.ITopologicalOperator4
Using releaser As New ESRI.ArcGIS.ADF.ComReleaser
releaser.ManageLifetime(pFCursor)
pQFilter.WhereClause = [String].Format("{0} in ({1})", pFClass.OIDFieldName, sender.Rows(e.RowIndex).Cells("colAdjacentOIDs").value)
pFCursor = pFClass.Search(pQFilter, True)
pFeature = pFCursor.NextFeature
Do Until pFeature Is Nothing
pGeometryBag.AddGeometry(pFeature.ShapeCopy)
pFeature = pFCursor.NextFeature
Loop
Select Case pFClass.ShapeType
Case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon
pTopoOp = New ESRI.ArcGIS.Geometry.Polygon
pTopoOp.ConstructUnion(pGeometryBag)
pPolygon = pTopoOp
pGeometry = pPolygon
Case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolyline
pTopoOp = New ESRI.ArcGIS.Geometry.Polyline
pTopoOp.ConstructUnion(pGeometryBag)
pPolyline = pTopoOp
pGeometry = pPolyline
End Select
pRgbColor.Red = 255
FlashGeometry(pGeometry, pRgbColor, My.ArcMap.Document.ActiveView.ScreenDisplay, 500)
End Using
Public Sub FlashGeometry(ByVal geometry As ESRI.ArcGIS.Geometry.IGeometry, ByVal color As ESRI.ArcGIS.Display.IRgbColor, ByVal display As ESRI.ArcGIS.Display.IDisplay, ByVal delay As System.Int32)
If geometry Is Nothing OrElse color Is Nothing OrElse display Is Nothing Then
Return
End If
display.StartDrawing(display.hDC, CShort(ESRI.ArcGIS.Display.esriScreenCache.esriNoScreenCache))
Select Case geometry.GeometryType
Case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon
'Set the flash geometry's symbol.
Dim simpleFillSymbol As ESRI.ArcGIS.Display.ISimpleFillSymbol = New ESRI.ArcGIS.Display.SimpleFillSymbolClass
simpleFillSymbol.Color = color
Dim symbol As ESRI.ArcGIS.Display.ISymbol = TryCast(simpleFillSymbol, ESRI.ArcGIS.Display.ISymbol) ' Dynamic Cast
symbol.ROP2 = ESRI.ArcGIS.Display.esriRasterOpCode.esriROPNotXOrPen
'Flash the input polygon geometry.
display.SetSymbol(symbol)
display.DrawPolygon(geometry)
System.Threading.Thread.Sleep(delay)
display.DrawPolygon(geometry)
Exit Select
Case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolyline
'Set the flash geometry's symbol.
Dim simpleLineSymbol As ESRI.ArcGIS.Display.ISimpleLineSymbol = New ESRI.ArcGIS.Display.SimpleLineSymbolClass
simpleLineSymbol.Width = 4
simpleLineSymbol.Color = color
Dim symbol As ESRI.ArcGIS.Display.ISymbol = TryCast(simpleLineSymbol, ESRI.ArcGIS.Display.ISymbol) ' Dynamic Cast
symbol.ROP2 = ESRI.ArcGIS.Display.esriRasterOpCode.esriROPNotXOrPen
'Flash the input polyline geometry.
display.SetSymbol(symbol)
display.DrawPolyline(geometry)
System.Threading.Thread.Sleep(delay)
display.DrawPolyline(geometry)
Exit Select
Case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPoint
'Set the flash geometry's symbol.
Dim simpleMarkerSymbol As ESRI.ArcGIS.Display.ISimpleMarkerSymbol = New ESRI.ArcGIS.Display.SimpleMarkerSymbolClass
simpleMarkerSymbol.Style = ESRI.ArcGIS.Display.esriSimpleMarkerStyle.esriSMSCircle
simpleMarkerSymbol.Size = 12
simpleMarkerSymbol.Color = color
Dim symbol As ESRI.ArcGIS.Display.ISymbol = TryCast(simpleMarkerSymbol, ESRI.ArcGIS.Display.ISymbol) ' Dynamic Cast
symbol.ROP2 = ESRI.ArcGIS.Display.esriRasterOpCode.esriROPNotXOrPen
'Flash the input point geometry.
display.SetSymbol(symbol)
display.DrawPoint(geometry)
System.Threading.Thread.Sleep(delay)
display.DrawPoint(geometry)
Exit Select
Case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryMultipoint
'Set the flash geometry's symbol.
Dim simpleMarkerSymbol As ESRI.ArcGIS.Display.ISimpleMarkerSymbol = New ESRI.ArcGIS.Display.SimpleMarkerSymbolClass
simpleMarkerSymbol.Style = ESRI.ArcGIS.Display.esriSimpleMarkerStyle.esriSMSCircle
simpleMarkerSymbol.Size = 12
simpleMarkerSymbol.Color = color
Dim symbol As ESRI.ArcGIS.Display.ISymbol = TryCast(simpleMarkerSymbol, ESRI.ArcGIS.Display.ISymbol) ' Dynamic Cast
symbol.ROP2 = ESRI.ArcGIS.Display.esriRasterOpCode.esriROPNotXOrPen
'Flash the input multipoint geometry.
display.SetSymbol(symbol)
display.DrawMultipoint(geometry)
System.Threading.Thread.Sleep(delay)
display.DrawMultipoint(geometry)
Exit Select
End Select
display.FinishDrawing()
End Sub
0 votos
Algo relacionado: electronics.stackexchange.com/q/76376/2028