2 Replies Latest reply on Jun 7, 2018 11:11 AM by Tom Faust

    Problem adding a new DesignGraphics feature

    Tom Faust

      I am able to create a DesignGraphics feature, give it a TEXTSTRING, FONT, SHAPE, etc. It is created and I can select it on the map. Selection outlines it in blue exactly where I expect it to be. However, the text does not appear. I can see other pre-existing DesignGraphics features display their text; some plain black text, some text in a bordered cell with yellow background. Mine is just empty.

       

      I don't understand...

      1. Why mine is invisible
      2. How some have background color and border and some are just text

       

      Here's what I see for mine with red circles around the selected feature and it's text value. Any thoughts?

        • Re: Problem adding a new DesignGraphics feature
          Tom Faust

          In addition I have noticed that DesignGraphics that do show up on the map have a BLOB in the Element column. My additions have NULL in the Element column. If this is the issue, the question then would be, what am I supposed to put in the Element column?

          • Re: Problem adding a new DesignGraphics feature
            Tom Faust

            We found the answer ourselves. Once you have the TextElement that looks like you want it (text, font, position, angle, etc.) you just need these lines of code:

             

            var feature = featureClass.CreateFeature();

            var annotationFeature = (IAnnotationFeature) feature;

            annotationFeature.Annotation = (IElement) textElement.ArcTextElement;

            feature.Store();

             

            Where featureClass is SDEADMIN.DESIGNGRAPHICS and you are in an editable workspace. Apparently setting Annotation fills in the Element BLOB and the rest of the columns automatically.

            Most importantly, it works.