<div dir="ltr">What do you mean by <font face="arial, helvetica, sans-serif"><i>"<span style="color:rgb(0,0,0)">The plugin runs correctly only the FIRST time.</span></i></font><div style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif"><i>Then, when it finishes, if I run again the plugin choosing an input2 vectorlayer, the processing algorithm doesn't see the input2 and my ouput remains output1."? </i></font></div><div style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif"><br></font></div><div style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">Are you calling the algorithm inside a loop? </font><span style="font-family:arial,helvetica,sans-serif">May I have a look at your code? Maybe the issue is in the Python code and not necessarily on QGIS.</span></div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">I usually use <b>processing.runandload()</b> because it automatically adds the resulting layer.</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">Regards,</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">Ben Hur</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 13, 2017 at 5:31 PM, Stefano Masera <span dir="ltr"><<a href="mailto:stefano.masera@arpa.piemonte.it" target="_blank">stefano.masera@arpa.piemonte.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:times new roman,new york,times,serif;font-size:12pt;color:#000000"><div>Thanks Nyali.<br></div><div>The reason is that if I use processing it doens't work correctly.<br></div><span class=""><div>In details, if I write:<br></div><div><br></div></span><div><span style="font-family:"courier new",courier,monaco,monospace,sans-serif;font-size:small">import processing</span><br><span style="font-family:"courier new",courier,monaco,monospace,sans-serif;font-size:small">processing.runalg("qgis:<wbr>multiparttosingleparts", input1, output1)</span></div><div><br></div><div>The plugin runs correctly only the FIRST time.<br></div><div>Then, when it finishes, if I run again the plugin choosing an input2 vectorlayer, the processing algorithm doesn't see the input2 and my ouput remains output1.<br></div><div>It's crazy!<br></div><div>It's something like a bad refresh..<br></div><div><br></div><div>If you have another solution....<br></div><div><br></div><div>Thank you very much.<br></div><div><br></div><div>Stefano<br></div><div><br></div><div><br></div><hr id="m_-5797722094695144985zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><span class=""><b>Da: </b>"Nyall Dawson" <<a href="mailto:nyall.dawson@gmail.com" target="_blank">nyall.dawson@gmail.com</a>><br><b>A: </b>"Stefano Masera" <<a href="mailto:stefano.masera@arpa.piemonte.it" target="_blank">stefano.masera@arpa.piemonte.<wbr>it</a>><br><b>Cc: </b>"qgis-developer" <<a href="mailto:qgis-developer@lists.osgeo.org" target="_blank">qgis-developer@lists.osgeo.<wbr>org</a>><br></span><b>Inviato: </b>Martedì, 13 giugno 2017 10:20:31<span class=""><br><b>Oggetto: </b>Re: [QGIS-Developer] multipartToSingleParts via code<br><div><br></div></span><span class="">On 13 June 2017 at 17:49, Stefano Masera<br><<a href="mailto:stefano.masera@arpa.piemonte.it" target="_blank">stefano.masera@arpa.piemonte.<wbr>it</a>> wrote:<br>> Hi Nyali,<br>> in a few words I want to do a multipartToSingleParts (for a VectorLayer) via<br>> code without using the processing module.<br><div><br></div>Any particular reason why?<br><div><br></div>In any case, I'd suggest copying the code used by processing:<br><a href="https://github.com/qgis/QGIS/blob/release-2_18/python/plugins/processing/algs/qgis/MultipartToSingleparts.py#L66" target="_blank">https://github.com/qgis/QGIS/<wbr>blob/release-2_18/python/<wbr>plugins/processing/algs/qgis/<wbr>MultipartToSingleparts.py#L66</a><br><div><br></div>Nyall<br><div><br></div></span><span class="">--<br>Questo messaggio e' stato analizzato ed e' risultato non infetto.<br>This message was scanned and is believed to be clean.<br><div><br></div></span></div><div><br></div></div></div><br>______________________________<wbr>_________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/qgis-<wbr>developer</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div dir="ltr"><span><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><font face="monospace, monospace"><div dir="ltr"><div><div>---</div><div><br><div><font size="2"><b>Engr. Ben Hur S. Pintor</b><br></font></div><font size="2"><i>Research Associate</i><br></font></div><font size="2">Phil-LiDAR 2 Project 5: REMap<br></font></div><font size="2">UP Training Center for Applied Geodesy and Photogrammetry<br></font></div><div><font size="2"><i><br></i></font></div><div><font size="2"><i>Juris Doctor<br></i></font></div><div><font size="2">College of Law<br></font></div><div dir="ltr"><div><div><div><div><div><div><font size="2"><font color="#990000"><b>University of the Philippines Diliman</b></font></font></div><div><font color="#000000"><font size="2">Quezon City 1101, PHL</font></font></div></div></div></div></div></div></div></font></div></div></div></div></div></div></div></span></div></div>
</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>