4

I have a model that creates a feature class and adds it to the map. The properties of the feature class reference a layer file for the symbology. However, I can't seem to find a good way to pass the labels as well so that the feature class is added with the labels visible.

Is there a way to do this?

5

No, there isn't a way to do this directly by using the ModelBuilder or GP tools in a model. However, you can use the arcpy Layer properties (showlabels) to make this happen after the model has run. Then either export the model to the Python script or rewrite the model by using Python manually. The arcpy showlabels method will be the last step in your model where you set up the labels to show up.

  • 5
    For better re-usability (if you need to do this repeatedly or often), you could also create a python script that JUST manages your map display (like turning on/off labels for select layers) and then add that script into your model. Don't forget to end the label script with arcpy.RefreshTOC() and/or arcpy.RefreshActiveView() otherwise you won't see the script changes applied until you manually refresh your session the next time. – RyanDalton Feb 18 '13 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.