Select to view content in your preferred language

Setting the scale range using Python for a large number of MXDs

844
2
12-15-2011 02:51 PM
JonathanShapiro
Emerging Contributor
Hi, I'm fairly new to Python and am looking for a way to open a large number of MXDs (one after the other) and setting the 'Don't show layer when zoomed out beyond / in beyond' parameters. I can take care of the first part but is there a way to set the 'out beyond' and 'in beyond' values using Python once I have an individual MXD loaded?

I can't seem to find a reference anywhere in the forums on online.

Thanks
Tags (2)
0 Kudos
2 Replies
JeffBarrette
Esri Regular Contributor
This can't be done with Python at 10.0.

At 10.1 we've added two new r/w properties to the Layer class:  maxScale and minScale.

You should be able to accomplish what you need with these.

Jeff
0 Kudos
DarylVan_Dyke
Deactivated User
As a workaround - you could set up a set of 'reference layers' with appropriate scale ranges (assuming you don't have many unique ranges you want to set), and then apply these range-template layer files as updates.

You'd have to query off the accessible properties, and then reset them after applying the templates, similar to how the 'export this modelbuilder as python' routine handles environment settings.

Not all layer properties are accessible through the Layer object. There are many properties available in the ArcMap Layer Properties  dialog box that are not exposed to the arcpy scripting environment (e.g., scale ranges, display properties, field aliases, symbology, and so on). The UpdateLayer function allows you to replace all layer properties available in ArcMap's Layer Properties dialog box using a layer (.lyr) file that contains the customizations.


http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Layer/00s300000008000000/
0 Kudos