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

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;
            stElement.Activate(activeView.ScreenDisplay);
            pGraphicsContainer.AddElement(stElement, 0);

Any coding help would be appreciated.

share|improve this 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

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.