How can I extract the geometry of a line callout and the border of an annotation featureclass in ArcGIS desktop. I want to transfert those to a separate featureclass.
I'm able to get the Anchor point of the callout, but it's not enough for my needs.
I have try to use following code, but it doesn't return nothing. In the code, I try to get a polyline, but I've also try to get a polygon with the same results. I'm using ArcMap version 9.3 but I also tried with 10 and I have same results. Quite strange also that the method QueryBoundary on IQueryGeometry says at run-time that it's not implemented!
Dim pActiveView As IActiveView = pMap
Dim pScreenDisplay As IScreenDisplay = pActiveView.ScreenDisplay
Dim pDisplayTransform As IDisplayTransformation = pScreenDisplay.DisplayTransformation
Dim pFDOGraphicsLayer As IFDOGraphicsLayer = pMap.Layer(0) 'The Annotation featureclass
Dim pFDOGraphicsLayerRead As IFDOGraphicsLayerRead = pFDOGraphicsLayer
pFDOGraphicsLayerRead.StartGeneratingGraphics(Nothing, pScreenDisplay, True, True, False)
Dim pTextElement As ITextElement = pFDOGraphicsLayerRead.NextGraphic
Do Until pTextElement Is Nothing
Dim pFormattedTextSymbol As IFormattedTextSymbol = pTextElement.Symbol
Dim pTextBackground As ITextBackground = pFormattedTextSymbol.Background
If TypeOf pTextBackground Is ILineCallout And pTextBackground IsNot Nothing Then
Dim pLineCallout As ILineCallout = pTextBackground
Dim pQueryGeometry As ESRI.ArcGIS.Display.IQueryGeometry = pLineCallout
Dim pElement As IElement = pTextElement
Dim pPointGeometry As IGeometry = pElement.Geometry
pScreenDisplay.StartDrawing(pScreenDisplay.WindowDC, ScreenDisplay.ActiveCache)
Dim pPolyline As IPolyline = New Polyline
pPolyline = pQueryGeometry.GetGeometry(pScreenDisplay.WindowDC, DisplayTransform, pPointGeometry)
If pPolyline IsNot Nothing Then
'At this point the polyline is always nothing***
MsgBox(pPolyline.Length)
End If
pScreenDisplay.FinishDrawing()
End If
pTextElement = pFDOGraphicsLayerRead.NextGraphic
Loop
Source: http://forums.esri.com/thread.asp?c=93&f=993&t=275411
1 Answer 1
The leader line geometry of a LineCallout is generated during draw and is not exposed for access/modification. SimpleLineCallouts allow for custom line geometries.