Problem: File size gets larger after using Find Best Label Placement and then changing label positions


After creating autolabels and using the Find Best Label Placement option, any manual movement of the labels causes the project file size to expand.


When graphics that were placed using Find Best Label Placement are moved, Arcview creates new siblings in the sibling list rather than overwriting the existing ones. Each time the labels are moved, the sibling list increases and so does the file size of the project.

Solution or Workaround

  1. Open the offending project.
  2. Open a new script window.

    A. Activate the Project window.
    B. Click the Scripts icon.
    C. Click New.

  3. Copy the following script into the new widow.


    theView = av.GetActiveDoc
    theTheme = theView.GetActiveThemes.Get(0)
    thecount = 0

    '** gets the theme's graphicset
    TheGraphics = theTheme.GetGraphics
    for each agraphic in theGraphics

    '** if the graphic is a label...
    if (aGraphic.is(graphiclabel)) then
    thesiblings = agraphic.getsiblings

    '** select all the visible siblings...
    for each s in thesiblings

    thevis_count = theview.getgraphics.getselected.count

    '** while the # of total siblings > the # of
    '** visible siblings...
    while (thevis_count < thesiblings.count)

    '** remove any orphaned siblings...
    for each i in ((thesiblings.count -1)..thevis_count)
    thecount = thecount + 1

    msgbox.info("Number of orphaned siblings removed for theme"
    ++ thetheme.getname+":" ++ thecount.asstring, "Done")

  4. Attach the script to a button on the View GUI.

    A. Compile the script.
    B. Switch to the Project window.
    C. Select Customize from the Project menu.
    D. On the Customize dialog box, click the Type dropdown arrow and click View.
    E. Select Buttons under Category.
    F. Click the New button.
    G. Double-click the Click property in the Customize dialog box.
    H. Type the name of the script in the Script Manager and click Select.
    I. Close the Customize dialog box.

    For more information, see "Customize dialog box" in ArcView Help.

  5. Open the view containing the labels.
  6. Make the theme to which the labels are attached active.
  7. Click the new button to run the script.