Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 30 characters in body; edited tags; edited title
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

How to get Getting selected feature y change atributte incrementaland changing attribute incrementally in pyqgis QGIS 3.4.xPyQGIS?

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()

How to get selected feature y change atributte incremental in pyqgis QGIS 3.4.x

I am using QGIS 3.4.x and i need change atributte value, by order selection, for example: I have 5 polygons,

| Order of selection | Number |
| Polygon 1............| set to 1...|
| Polygon 4............| set to 2...|
| Polygon 3............| set to 3...|

Here my code

capaA = iface.activeLayer()
features = capaA.selectedFeatures()
capaA.startEditing()
contador = 1
capaA.changeAttributeValue(f.id(), 5, contador)
capaA.commitChanges()

Getting selected feature and changing attribute incrementally in PyQGIS?

I am using QGIS 3.4.x and i need change attribute value, by order selection, for example:

I have 5 polygons,

| 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()
Source Link
leotv
  • 449
  • 6
  • 11

How to get selected feature y change atributte incremental in pyqgis QGIS 3.4.x

I am using QGIS 3.4.x and i need change atributte value, by order selection, for example: I have 5 polygons,

| Order of selection | Number |
| Polygon 1............| set to 1...|
| Polygon 4............| set to 2...|
| Polygon 3............| set to 3...|

Here my code

capaA = iface.activeLayer()
features = capaA.selectedFeatures()
capaA.startEditing()
contador = 1
capaA.changeAttributeValue(f.id(), 5, contador)
capaA.commitChanges()