I'm running into a similar problem. I'm attempting to create a map with two layers, one of which is visible at scales greater than 1:500000, the other being visible at scales less than 1:500000. I had attempted to define a function to conditionally set the visibility of the layer based on the dataframe's current scale, but am lost on how to update the visibility parameters of the layers on a change of scale within the map. For example: def closeVisible(scale):
if scale < 500000:
return True
else:
return False
def farVisible(scale)
if scale > 500000:
return True
else:
return False I would define the visibility of the layers like so: layer1.visible = closeVisible(dataframe.scale)
layer2.visible = farVisible(dataframe.scale) At 10.0, this requires a bit of extra logic but it is possible. You would need to add your layer file multiple times, uniquely name each layer and then check the data frame scale and turn on/off layers.... I'm not sure I understand what you mean by "check the data frame scale and turn on/off layers." Are you indicating that this should be done statically, as coded above? Is there another way to do this? Ideally, every time dataframe.scale changed, the layer visibility would be redefined using the listed functions. Any help is greatly appreciated! Thanks, Paul EDIT: I should have mentioned in my initial post that dataframe.scale is being changed by zooming in and out of the map within ArcMap. Is there anything in the ArcPy library or other available Python libraries that interfaces with the programs scale setting function? My function definition won't work because visible is strictly a boolean type and is set by the function only once, after which I'm assuming the function instance is tossed into cyber-limbo. Then end goal is to be able to script the creation of a raster layer every day with a maximum and minimum scale setting-- a simple task I'm assuming with 10.1. Is the ArcPy module from 10.1 available for download aside from installing the full 10.1 beta?
... View more