I am using QGIS 3.4.x and i need change atributteattribute value, by order selection, for example: I
I have 5 polygons,
| Order of selection | Number |
| Polygon 1............| set to 1...|
| Polygon 4............| set to 2...|
| Polygon 3............| set to 3...|
| Order of selection | Number |
| Polygon 1............| set to 1...|
| Polygon 4............| set to 2...|
| Polygon 3............| set to 3...|
Here is my code:
capaA = iface.activeLayer()
features = capaA.selectedFeatures()
capaA.startEditing()
contador = 1
capaA.changeAttributeValue(f.id(), 5, contador)
capaA.commitChanges()