Hello,
I want to change the geometry (textpath) of existing annotation features so that the curvature gets horizontal. I tried several things but did not succeed.
Can somebody help me with the code i already have?
Greetings, Henk
I want to change the geometry (textpath) of existing annotation features so that the curvature gets horizontal. I tried several things but did not succeed.
Can somebody help me with the code i already have?
Code:
Set pFeatureCursor = pFeatureclass.Update(pFilter, False)
Set pFeature = pFeatureCursor.NextFeature
While Not pFeature Is Nothing
Dim pAnnoFeat As IAnnotationFeature
Set pAnnoFeat = pFeature
Dim pElement As IElement
Set pElement = pAnnoFeat.Annotation
Dim pTextElement As ITextElement
Set pTextElement = pElement
Dim pTextSym As ISimpleTextSymbol
Set pTextSym = pTextElement.Symbol
If Not pTextSym Is Nothing Then
Dim pTextPath As ITextPath
Set pTextPath = pTextSym.TextPath
If TypeOf pTextPath Is IOverposterTextPath Then
If TypeOf pElement.Geometry Is IPolyline Then
Dim pPointCol As IPointCollection
Set pPointCol = New Polyline
Set pPointCol = pElement.Geometry
' Just keep start- and endpoint
pPointCol.RemovePoints 1, pPointCol.PointCount - 2
'....... Replace textPath here ......
pFeatureCursor.UpdateFeature pFeature
End If
End If
End If
Set pFeature = pFeatureCursor.NextFeature
Wend
End If