What do you mean by *"The plugin runs correctly only the FIRST time.* *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."? *
Are you calling the algorithm inside a loop? May I have a look at your code? Maybe the issue is in the Python code and not necessarily on QGIS. I usually use *processing.runandload()* because it automatically adds the resulting layer. Regards, Ben Hur On Tue, Jun 13, 2017 at 5:31 PM, Stefano Masera < [email protected]> wrote: > Thanks Nyali. > The reason is that if I use processing it doens't work correctly. > In details, if I write: > > import processing > processing.runalg("qgis:multiparttosingleparts", input1, output1) > > The plugin runs correctly only the FIRST time. > 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. > It's crazy! > It's something like a bad refresh.. > > If you have another solution.... > > Thank you very much. > > Stefano > > > ------------------------------ > *Da: *"Nyall Dawson" <[email protected]> > *A: *"Stefano Masera" <[email protected]> > *Cc: *"qgis-developer" <[email protected]> > *Inviato: *Martedì, 13 giugno 2017 10:20:31 > *Oggetto: *Re: [QGIS-Developer] multipartToSingleParts via code > > On 13 June 2017 at 17:49, Stefano Masera > <[email protected]> wrote: > > Hi Nyali, > > in a few words I want to do a multipartToSingleParts (for a VectorLayer) > via > > code without using the processing module. > > Any particular reason why? > > In any case, I'd suggest copying the code used by processing: > https://github.com/qgis/QGIS/blob/release-2_18/python/ > plugins/processing/algs/qgis/MultipartToSingleparts.py#L66 > > Nyall > > -- > Questo messaggio e' stato analizzato ed e' risultato non infetto. > This message was scanned and is believed to be clean. > > > > _______________________________________________ > QGIS-Developer mailing list > [email protected] > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer > -- --- *Engr. Ben Hur S. Pintor* *Research Associate* Phil-LiDAR 2 Project 5: REMap UP Training Center for Applied Geodesy and Photogrammetry *Juris Doctor* College of Law *University of the Philippines Diliman* Quezon City 1101, PHL
_______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
