Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am adding scale text to a page layout. The code works, but the map units on the text scale still appear as miles and not feet as coded. Here is the code snippet to add scale text....

            IEnvelope stEnvelope = new EnvelopeClass();
            stEnvelope.PutCoords(14.1, 1.85, 15.37, 2.04);
            IUID uid3 = new UIDClass();
            uid3.Value = "esriCarto.ScaleText";
            IScaleText pScaleText = new ScaleTextClass();
            INumericFormat pNumericFormat = new NumericFormatClass();
            pNumericFormat.UseSeparator = false;
            pNumericFormat.RoundingValue = 2;
            ITextSymbol stTextSymbol = new TextSymbolClass();
            stTextSymbol.Color = pRgbColor;
            stTextSymbol.Size = 10;
            pScaleText.NumberFormat = pNumericFormat as INumberFormat;
            pScaleText.PageUnits = esriUnits.esriInches;
            pScaleText.PageUnitLabel = "inches";

            //Assign the Map Units to be feet on the Text Scale
            pScaleText.MapUnits = esriUnits.esriFeet;
            pScaleText.MapUnitLabel = "feet";

            //pScaleText.Style = esriScaleTextStyleEnum.esriScaleTextCustom;
            pScaleText.Symbol = stTextSymbol;
            IFrameElement stFrameElement = pGraphicsContainer.FindFrame(map);
            IMapFrame stMapFrame = stFrameElement as IMapFrame;
            IMapSurroundFrame StMapSurroundFrame = sbMapFrame.CreateSurroundFrame(uid3 as UID, null);
            IElement stElement = StMapSurroundFrame as IElement;
            stElement.Geometry = stEnvelope;
            pGraphicsContainer.AddElement(stElement, 0);

Any coding help would be appreciated.

share|improve this question

closed as too localized by PolyGeo, Devdatta Tengshe, BradHards, iant Jun 24 '13 at 12:10

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

@D Amett, Can you do the value conversion from miles to feet for your variable? – artwork21 Jul 17 '12 at 19:54
I don't understand your question. Please expand. – D Arnett Jul 17 '12 at 21:40
@D Amett, Your text is in miles. Can you simply do the conversion from miles to feet within your code for the text element? – artwork21 Jul 18 '12 at 19:03