In my script I select a feature (layer with definition query) and set the extent of the dataframe to the extent of this feature. This works fine, as long as just one feature is selected.Sometimes though, two features need to be selected. In this case, I do get the extent of the features and I can set the extent of the dataframe, but nothing gets drawn.Here's my code:
Layer_xy.definitionQuery = DefinitionQuery
newExtent = Layer_xy.getExtent(True)
# newExtent = Layer_xy.getSelectedExtent(True)
df.extent = newExtent
df.panToExtent(df.extent)
print "Extent of feature:\nXMin: %f, YMin: %f, \nXMax: %f, YMax: %f" % \
(df.extent.XMin,df.extent.YMin,df.extent.XMax,df.extent.YMax)
I tried it both with Layer_xy.getExtent and Layer_xy.getSelectedExtent and with or without panToExtent, with Layer_xy.getSelectedExtent(True) or (False), but nothing was ever drawn...Any suggestions? Thanks for your help.Vera