<div dir="ltr"><div dir="ltr">Hi Matteo,<div><br></div><div>If you want and if you have the time, we could have a look at this issue at the QGIS Contributors Meeting in Firenze :)</div><div><br></div><div>Regards!</div><div><br></div><div>Germán</div></div><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El lun, 1 ago 2022 a las 17:07, matteo (<<a href="mailto:matteo.ghetta@gmail.com" target="_blank">matteo.ghetta@gmail.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi German,<br>
<br>
yes in your way it is working. But what if you try not with the <br>
algorithm/model id, but with an instance of the algorithm?<br>
<br>
In the docs I read "Either an instance of an algorithm, or an <br>
algorithm's ID", therefore I'm trying to set up an instance of my <br>
algorithm and then passing it to the method<br>
<br>
Cheers and thanks<br>
<br>
Matteo<br>
<br>
On 8/1/22 16:17, Germán Carrillo wrote:<br>
> Hi Matteo,<br>
> <br>
> I've been successfully using /execAlgorithmDialog()/ instead [0]:<br>
> <br>
> /processing.execAlgorithmDialog("my_provider:my_algorithm", params)/<br>
> <br>
> where, /params/ is a dict with the pre-filled values you have. You can <br>
> see an example at [1].<br>
> <br>
> Regards,<br>
> <br>
> Germán<br>
> -----------<br>
> [0] <br>
> <a href="https://github.com/qgis/QGIS/blob/2d1aa68f0d044f2aced7ebeca8d2fa6b754ac970/python/plugins/processing/tools/general.py#L185" rel="noreferrer" target="_blank">https://github.com/qgis/QGIS/blob/2d1aa68f0d044f2aced7ebeca8d2fa6b754ac970/python/plugins/processing/tools/general.py#L185</a> <<a href="https://github.com/qgis/QGIS/blob/2d1aa68f0d044f2aced7ebeca8d2fa6b754ac970/python/plugins/processing/tools/general.py#L185" rel="noreferrer" target="_blank">https://github.com/qgis/QGIS/blob/2d1aa68f0d044f2aced7ebeca8d2fa6b754ac970/python/plugins/processing/tools/general.py#L185</a>><br>
> [1] <br>
> <a href="https://github.com/SwissTierrasColombia/LADM-COL-Add-on-Ambiente/blob/master/ladm_col_environment_add_on.py#L140" rel="noreferrer" target="_blank">https://github.com/SwissTierrasColombia/LADM-COL-Add-on-Ambiente/blob/master/ladm_col_environment_add_on.py#L140</a> <<a href="https://github.com/SwissTierrasColombia/LADM-COL-Add-on-Ambiente/blob/master/ladm_col_environment_add_on.py#L140" rel="noreferrer" target="_blank">https://github.com/SwissTierrasColombia/LADM-COL-Add-on-Ambiente/blob/master/ladm_col_environment_add_on.py#L140</a>><br>
> <br>
> <br>
> El lun, 1 ago 2022 a las 15:23, matteo via QGIS-Developer <br>
> (<<a href="mailto:qgis-developer@lists.osgeo.org" target="_blank">qgis-developer@lists.osgeo.org</a> <br>
> <mailto:<a href="mailto:qgis-developer@lists.osgeo.org" target="_blank">qgis-developer@lists.osgeo.org</a>>>) escribió:<br>
> <br>
>     Hi all,<br>
> <br>
>     I've a set of custom processing scripts within a plugin (that is both<br>
>     "normal" and processing provider plugin).<br>
> <br>
>     I'm trying to executing the dialog of these algorithm from one of the<br>
>     main plugin file. I found the processing.createAlgorithmDialog [0], but<br>
>     it is constantly crashing when I'm passing the instance of the<br>
>     algorithm:<br>
> <br>
>     my_alg = MyCustomAlg()<br>
>     my_dialog = my_alg.createAlgorithmDialog(custom_dict)<br>
> <br>
>     ## crash here<br>
> <br>
>     Thinking it was a problem of the threads I also tried to overwrite the<br>
>     `flag` method in the algorithm by setting also<br>
>     QgsProcessingAlgorithm.FlagNoThreading but with the same results.<br>
> <br>
>     I know I can run the processing algorithm with processing.run(....) but<br>
>     I need to open the dialog pre-filled with custom parameters and to get<br>
>     also some other outputs besides the standard ones (like the<br>
>     QgsFeatureSink path)<br>
> <br>
>     Thanks for any suggestion<br>
> <br>
>     Cheers<br>
> <br>
>     Matteo<br>
> <br>
> <br>
>     [0]<br>
>     <a href="https://github.com/qgis/QGIS/blob/master/python/plugins/processing/tools/general.py#L155" rel="noreferrer" target="_blank">https://github.com/qgis/QGIS/blob/master/python/plugins/processing/tools/general.py#L155</a> <<a href="https://github.com/qgis/QGIS/blob/master/python/plugins/processing/tools/general.py#L155" rel="noreferrer" target="_blank">https://github.com/qgis/QGIS/blob/master/python/plugins/processing/tools/general.py#L155</a>><br>
> <br>
>     _______________________________________________<br>
>     QGIS-Developer mailing list<br>
>     <a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a> <mailto:<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">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/mailman/listinfo/qgis-developer</a><br>
>     <<a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>><br>
>     Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>     <<a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>><br>
> <br>
> <br>
> <br>
> -- <br>
> -----------<br>
>     |\__<br>
> (:>__)(<br>
>     |/<br>
> Soluciones Geoinformáticas Libres<br>
> <a href="http://geotux.tuxfamily.org/" rel="noreferrer" target="_blank">http://geotux.tuxfamily.org/</a> <<a href="http://geotux.tuxfamily.org/" rel="noreferrer" target="_blank">http://geotux.tuxfamily.org/</a>><br>
> <a href="https://twitter.com/GeoTux2" rel="noreferrer" target="_blank">https://twitter.com/GeoTux2</a> <<a href="http://twitter.com/GeoTux2" rel="noreferrer" target="_blank">http://twitter.com/GeoTux2</a>><br>
> <br>
> <<a href="http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo" rel="noreferrer" target="_blank">http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo</a>><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>-----------<br></div><div>   |\__  <br>(:>__)(<br>   |/    <br>Soluciones Geoinformáticas Libres                            <br><a href="http://geotux.tuxfamily.org/" target="_blank">http://geotux.tuxfamily.org/</a><br><a href="http://twitter.com/GeoTux2" target="_blank">https://twitter.com/GeoTux2</a></div><div><br></div><div><div><a href="http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo" target="_blank"><img src="http://gis.stackexchange.com/users/flair/4972.png"></a></div></div></div></div></div></div></div></div></div>