<div dir="ltr">Hi Frank,<div><br></div><div>On Fri, 29 Jun 2018 at 09:35, Frank Broniewski <<a href="mailto:hallo@frankbroniewski.com">hallo@frankbroniewski.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Anyway, my testing-algorithm-script is still not working. It runs through, but I do not get the expected result loaded into the layer tree. I suppose it runs through - the  output from the 'qgis:pointsalonglines' is a QgsVectorLayer - but after finishing I get nuthink back.<br><br></blockquote><div><br></div><div>

<div style="text-decoration-style:initial;text-decoration-color:initial">I had a similar problem. I think it's because the template defines the output as a feature sink, so you assume you have to use the same. I think if you change your definition from:</div><div style="text-decoration-style:initial;text-decoration-color:initial"><br></div><blockquote style="text-decoration-style:initial;text-decoration-color:initial;margin:0px 0px 0px 40px;border:none;padding:0px"><div><span class="gmail-im" style="color:rgb(80,0,80);background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">self.addParameter(</span></div><div><span class="gmail-im" style="color:rgb(80,0,80);background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">            QgsProcessingParameterFeatureSink(</span></div><div><span class="gmail-im" style="color:rgb(80,0,80);background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">                self.OUTPUT,</span></div><div><span class="gmail-im" style="color:rgb(80,0,80);background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">               <span> </span><a href="http://self.tr/" rel="noreferrer" target="_blank" style="color:rgb(17,85,204)">self.tr</a>('Center line')</span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">            )</span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">        )</span></div></blockquote><div style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="text-decoration-style:initial;text-decoration-color:initial">to: </div><blockquote style="text-decoration-style:initial;text-decoration-color:initial;margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>self.addParameter(</div></div><div><div>            QgsProcessingParameterVectorDestination(</div></div><div><div>                self.OUTPUT,</div></div><div><div>                <a href="http://self.tr">self.tr</a>('Center line')</div></div><div><div>            )</div></div><div><div>        )</div></div></blockquote><br style="text-decoration-style:initial;text-decoration-color:initial"><div style="text-decoration-style:initial;text-decoration-color:initial">and then in processAlgorithm you need to add output as a layer you can work with:</div><div style="text-decoration-style:initial;text-decoration-color:initial"><br></div><blockquote style="text-decoration-style:initial;text-decoration-color:initial;margin:0px 0px 0px 40px;border:none;padding:0px"><div>output = self.parameterAsOutputLayer(parameters,self.OUTPUT,context)</div></blockquote><div style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="text-decoration-style:initial;text-decoration-color:initial">Finally, in your `params` dict, change the value for OUTPUT from `memory:` to `output`.</div><div style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="text-decoration-style:initial;text-decoration-color:initial">The new syntax is more complicated than it used to be, and it takes some time to wrap your head around it. I do find that it gets easier once you've got a couple of scripts under your belt.</div><div style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="text-decoration-style:initial;text-decoration-color:initial">Rudi</div>

 </div></div></div>