a00578107

Change annotation size with code??

Discussion created by a00578107 on Jun 3, 2010
Latest reply on Jun 3, 2010 by kirkktx
I am wondering how I can change the size of my annotation - the data is stored in an SDE geodatabase, and I can't change the fontsize in the database itself because it is used in multiple applications. From my digging around I can see that I need to use a symbolsubstitution, which will temporarily change the annotation size but can't figure out how it works. I have successfully changed the color, but how to change the size?

Please help! The code for my test file that currently works to load the layer and change the annotation color is below. Any feedback, ideas, or examples would be hugely appreciated!

Private Function mxDocument_opendocument() As Boolean

Dim pPropset As IPropertySet
Set pPropset = New PropertySet
With pPropset
.SetProperty "Server", "*****"
.SetProperty "Instance", "*****"
.SetProperty "user", "*****"
.SetProperty "password", "*****"
.SetProperty "version", "*****"
End With

Dim pworkSpacename As IWorkspaceName
Set pworkSpacename = New WorkspaceName
pworkSpacename.WorkspaceFactoryProgID = "esricore.SdeWorkspaceFactory"
pworkSpacename.ConnectionProperties = pPropset

Dim pdatasetName As IDatasetName
Set pdatasetName = New FeatureClassName

pdatasetName.Name = "*****.dbo.SS_SanlineAnno"
Set pdatasetName.WorkspaceName = pworkSpacename

Dim pname As IName
Set pname = pdatasetName

Dim ptable As ITable
Set ptable = pname.Open

Dim pfeatclass As IDataset
Set pfeatclass = ptable

Dim pAnnotationLayer As IAnnotationLayer
Dim pFDOGraphicsLayerFactory As IFDOGraphicsLayerFactory
Set pFDOGraphicsLayerFactory = New FDOGraphicsLayerFactory
Dim player As ILayer
Set pAnnotationLayer = player
Set pAnnotationLayer = pFDOGraphicsLayerFactory.OpenGraphicsLayer(pfeatclass.Workspace, Nothing, "*****.dbo.SS_SanlineAnno")

Dim pRGBColorAnno As IRgbColor
Set pRGBColorAnno = New RgbColor

With pRGBColorAnno
.Red = 255
.Green = 0
.Blue = 0
End With

Dim pFDOGraphicsLayer As IFDOGraphicsLayer
Dim pFDOGraphicsRead As IFDOGraphicsLayerRead
Dim symbolSubstitution As ISymbolSubstitution

Set pFDOGraphicsLayer = pAnnotationLayer
Set pFDOGraphicsRead = pFDOGraphicsLayer
Set symbolSubstitution = pFDOGraphicsRead

symbolSubstitution.SubstituteType = esriSymbolSubstituteColor
Set symbolSubstitution.MassColor = pRGBColorAnno
Set symbolSubstitution.InlineColor = pRGBColorAnno

Dim pmap As IMap
Dim pmxdoc As IMxDocument

Set pmxdoc = ThisDocument
Set pmap = pmxdoc.ActiveView

pmap.AddLayer pAnnotationLayer

Dim pav As IActiveView
Set pav = pmap

pav.Refresh

End Function

Outcomes