How to programmatically change colors of CadAnnotationLayer?

449
0
04-30-2013 03:38 AM
AntonPerlov1
New Contributor
I need to add Annotation layer from CAD file to arcmap. Unfortunately all annotations have different colors, but they must be represented in black. I've tried some methods to do it like this:

                CadAnnotationLayerClass newlayer = new CadAnnotationLayerClass();
                newlayer.DataSourceType = "CAD Annotation Feature Class";
                newlayer.Name = "Annotations";
               
               
                newlayer.FeatureClass = pFeatureWorkspace.OpenFeatureClass(System.String.Concat(fc_name,
   ":Annotation")); ;
                //newlayer.NextFeatureAndGraphic(
                ICoverageAnnotationLayer pCALayer = newlayer as ICoverageAnnotationLayer;

                RgbColorClass color = new RgbColorClass();
                color.Red=0;
                color.Green=0;
                color.Blue=0;
                color.Transparency = 255;
                ESRI.ArcGIS.DataSourcesFile.ICadDrawingLayers pCadDwgLayers =
    (ESRI.ArcGIS.DataSourcesFile.ICadDrawingLayers)newlayer;
                string colors="";
               
               
                   

                int symbolcount = pCALayer.SymbolCount;
              
                for (int i = 0; i < symbolcount; i++)
                {
                    //newlayer.f

                  
                   pCALayer.set_FontColor(i, color);
                   pCALayer.TextSymbol.Color = color;
                   
                 
                 
                    //newlayer.TextSymbol.Color.ToString();
                   
                }

but the colors of the annotations did not change. Can anyone help me with that annoying problem&
0 Kudos
0 Replies