Hi,
I discovered that ZoomToLayer function doesn't work if the layer with
selected features is not "selected in the list of layers".
I do this:
mapCanvas=self.iface.mapCanvas()
mapCanvas.setExtent(lay.extent())
mapCanvas.zoomToSelected()
mapCanvas.refresh()
how can I select that layer?