ARCVIEW 3.0 LEGEND TEXTSIZE BUTTON Here's a script that allows you to set the text size of a legend frame, and it will stay that way when you save and reload the project. The trick? It actually resets the bounds of the LegendFrame until the resulting text size converges on the desired value. ======================================================================= INSTALLING THE TEXTSIZE BUTTON IN THE DEFAULT PROJECT 1) Begin a NEW ArcView 3.0 session. 2) Create a new script by double-clicking on the "Scripts" icon 3) Use "Properties..." under the "Script" menu to rename Script1 to Layout.LegendTextSize 4) Paste the following text: '====================================================================== ' Layout.LegendTextSize ' sets the text size of a legend frame '**** get legend frame data theLayout = av.GetActiveDoc G_List = theLayout.GetGraphics.GetSelected theObj = G_List.Get(0) theBounds = theObj.GetBounds theOrigin = theBounds.ReturnOrigin theSymbolList = theObj.ReturnSymbols for each s in theSymbolList if (s.Is(TextSymbol)) then theTextSize = s.GetSize break end end result = MsgBox.Input("Enter text size:","Legend Text",theTextSize.AsString) if (result = nil) then return nil end newTextSize = result.AsNumber '**** set text size theObj.Invalidate theScale = newTextSize / theTextSize X = theBounds.GetWidth * theScale Y = theBounds.GetHeight * theScale IsDone = FALSE while (IsDone.Not) newBounds = Rect.Make(theOrigin, X@Y) theObj.SetBounds(newBounds) '**** check text size theSymbolList = theObj.ReturnSymbols for each s in theSymbolList if (s.Is(TextSymbol)) then ts = s.GetSize break end end temp1 = (ts * 10000).Round temp2 = (newTextSize * 10000).Round if (temp1 = temp2) then IsDone = TRUE else X = X * (newTextSize / ts) Y = Y * (newTextSize / ts) end end theObj.Draw theObj.Invalidate '====================================================================== 5) Create a new script, named Layout.LegendTSUpdate, with the following text: '====================================================================== ' Layout.LegendTSUpdate ' Update script for Layout.LegendTextSize theLayout = av.GetActiveDoc G_List = theLayout.GetGraphics.GetSelected Enabled = true if (G_List.Count = 0) then Enabled = false else theObj = G_List.Get(0) if (theObj.Is(LegendFrame).Not) then Enabled = false end end SELF.SetEnabled(Enabled) '====================================================================== 6) Compile and close both scripts 7) Double-click the tool bar, choose "Layout" and "Buttons", and create a new button 8) Double-click "Click" and select Layout.LegendTextSize 9) Double-click "Update" and select Layout.LegendTSUpdate 10) Double-click "Icon" and select FrameLegend 11) Double-click "Help" and enter: Legend Text Size//Set Legend Frame Text Size 12) Click the "Make Default Button" and then close the Customize dialog box 14) EXIT ArcView (do not save changes to "Untitled") and you're done! ======================================================================= INSTALLING THE BUTTON IN A SPECIFIC PROJECT 1) Open the desired project and follow steps 2-11 above 2) Close the "Customizer" and save the project ======================================================================= USING THE TEXTSIZE BUTTON 1) Select the legend frame for which you want to set the text size 2) Click the Legend Text Size button 3) Enter the desired text size and click the OK button. Enjoy! ======================================================================= Mark Cederholm plp@pierssen.com http://www.pierssen.com/PC/arcinfo.htm http://www.pierssen.com/arcview/arcview.htm