<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Thanks a lot! It worked!! :D<br>
<br>
<div class="moz-cite-prefix">El 07/01/2016 a las 17:56, Matthias
Kuhn escribió:<br>
</div>
<blockquote cite="mid:568E98A3.5080303@opengis.ch" type="cite">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
Hi,<br>
<br>
The second line reverts the changes from the first line here:<br>
<br>
<font face="Courier New, Courier, monospace"><i>
lyr.changeAttributeValue(fid,12,"0")</i><i><br>
</i><i> lyr.updateFeature(f)</i></font><br>
<br>
Either use<br>
<font face="Courier New, Courier, monospace"><i>
lyr.changeAttributeValue(fid,12,"0")</i><i><br>
</i></font>or<br>
<font face="Courier New, Courier, monospace"><i><font
face="Courier New, Courier, monospace"><i> f[12] = 0</i></font><br>
lyr.updateFeature(f)</i></font><br>
<br>
<div class="moz-cite-prefix">Cheers<br>
Matthias<br>
<br>
On 01/07/2016 05:52 PM, Luís Miguel Royo Pérez wrote:<br>
</div>
<blockquote cite="mid:568E97BF.2070905@gmail.com" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=utf-8">
Hello everyone,<br>
<br>
I'm trying to modify the values of some selected features. I
have written this small script, but nothing happens when I run
it. Is there something that I've missed? Here is my code.<br>
<br>
<font face="Courier New, Courier, monospace"><i>lyr =
qgis.utils.iface.activeLayer()</i><i><br>
</i><i>features = lyr.selectedFeatures()</i><i><br>
</i><i><br>
</i><i>lyr.startEditing()</i><i><br>
</i><i>lyr.updateFields()</i><i><br>
</i><i>for f in features:</i><i><br>
</i><i> fid= f.id()</i><i><br>
</i><i> lyr.changeAttributeValue(fid,12,"0")</i><i><br>
</i><i> lyr.updateFeature(f)</i><i><br>
</i><i> print "elemento alterado"</i><i><br>
</i><i><br>
</i><i>lyr.commitChanges()</i></font><br>
<br>
Thanks per advance!!<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Qgis-developer mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a>
List info: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
Unsubscribe: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Matthias Kuhn
OPENGIS.ch - <a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://www.opengis.ch">https://www.opengis.ch</a>
Spatial • (Q)GIS • PostGIS • Open Source</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Qgis-developer mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a></pre>
</blockquote>
<br>
</body>
</html>