<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        mso-fareast-language:EN-GB;}
span.gmail-line
        {mso-style-name:gmail-line;}
span.gmail-n
        {mso-style-name:gmail-n;}
span.gmail-o
        {mso-style-name:gmail-o;}
span.gmail-p
        {mso-style-name:gmail-p;}
span.gmail-s
        {mso-style-name:gmail-s;}
span.EmailStyle25
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Thank you for your answer as I think that has got me in the right direction. It will either be execAlgorithmDialog or the createAlgorithmDialog you reference.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Unfortunately I’m having a little trouble getting it to find the algorithm I’m trying to run at present but that led me to notice what might be a bug. Of course it might be intentional but execAlgorithmDialog
 returns False instead of None if it doesn’t find the algorithm. That in turn leads to an error message which appears accidental when you run the createAlgorithmDialog function.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">I’ve created (probably badly) a pull request (</span><a href="https://github.com/qgis/QGIS/pull/31899">https://github.com/qgis/QGIS/pull/31899</a>) to show the line I’m referring to.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">It would be good to know how to actually setup and create that pull request correctly really but I never have time to get my head around all the processes involved. We work on Windows machines which Visual Studio so I never full trust the
 formatting etc but who knows it might be safe on such a small change. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Anyway, it would be useful to know if that is a bug or not and I’m sure I’ll work out why it didn’t find my script shortly so thanks for your help
<span style="font-family:"Segoe UI Emoji",sans-serif">😊</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Paul<span style="mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Luigi Pirelli <luipir@gmail.com>
<br>
<b>Sent:</b> 20 September 2019 07:31<br>
<b>To:</b> Paul Wittle <P.Wittle@dorsetcc.gov.uk><br>
<b>Cc:</b> qgis-developer@lists.osgeo.org<br>
<b>Subject:</b> Re: [QGIS-Developer] Running vs triggering/opening a custom process via Python<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">you can get the dialog of the processing algorithm you want and use that... hereafter a snippet<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<pre><span class="gmail-line">    </span><span class="gmail-n">dialog</span><span class="gmail-line"> </span><span class="gmail-o">=</span><span class="gmail-line"> </span><span class="gmail-n">processing</span><span class="gmail-o">.</span><span class="gmail-n">createAlgorithmDialog</span><span class="gmail-p">(</span><span class="gmail-s">"model:AjustarRasterGCP"</span><span class="gmail-p">,</span><span class="gmail-line">  </span><o:p></o:p></pre>
<pre><span class="gmail-line">                    </span><span class="gmail-p">{</span><span class="gmail-s">'puntosgcp'</span><span class="gmail-p">:</span><span class="gmail-n">zeroDeltaHeighPoints</span><span class="gmail-p">,</span><o:p></o:p></pre>
<pre><span class="gmail-line">                     </span><span class="gmail-s">'rastermdsuav'</span><span class="gmail-p">:</span><span class="gmail-s">''</span><span class="gmail-p">,</span><o:p></o:p></pre>
<pre><span class="gmail-line">                     </span><span class="gmail-s">'rastermdtlidar'</span><span class="gmail-p">:</span><span class="gmail-s">''</span><span class="gmail-p">,</span><o:p></o:p></pre>
<pre><span class="gmail-line">                     </span><span class="gmail-s">'grass7:r.mapcalc.simple_1:Raster MDS_UAV Ajustado'</span><span class="gmail-p">:</span><span class="gmail-n">QgsProcessing</span><span class="gmail-o">.</span><span class="gmail-n">TEMPORARY_OUTPUT</span><span class="gmail-p">,</span><o:p></o:p></pre>
<pre><span class="gmail-line">                     </span><span class="gmail-s">'saga:thinplatesplinetin_1:ErrorSurface'</span><span class="gmail-p">:</span><span class="gmail-n">QgsProcessing</span><span class="gmail-o">.</span><span class="gmail-n">TEMPORARY_OUTPUT</span><span class="gmail-p">})</span><o:p></o:p></pre>
<pre><span class="gmail-line">    </span><span class="gmail-n">dialog</span><span class="gmail-o">.</span><span class="gmail-n">show</span><span class="gmail-p">()</span><o:p></o:p></pre>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Luigi Pirelli<br>
<br>
**************************************************************************************************<br>
* LinkedIn: <a href="https://www.linkedin.com/in/luigipirelli" target="_blank">https://www.linkedin.com/in/luigipirelli</a><br>
* Stackexchange: <a href="http://gis.stackexchange.com/users/19667/luigi-pirelli" target="_blank">
http://gis.stackexchange.com/users/19667/luigi-pirelli</a><br>
* GitHub: <a href="https://github.com/luipir" target="_blank">https://github.com/luipir</a><br>
* Book: <a href="https://www.packtpub.com/eu/application-development/mastering-geospatial-development-qgis-3x-third-edition" target="_blank">Mastering QGIS3 - 3rd Edition</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">* Hire a team: <a href="http://www.qcooperative.net" target="_blank">
http://www.qcooperative.net</a><br>
**************************************************************************************************<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Thu, 19 Sep 2019 at 12:49, Paul Wittle <<a href="mailto:paul.wittle@dorsetcouncil.gov.uk">paul.wittle@dorsetcouncil.gov.uk</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Hi,<br>
<br>
Sorry if this is a bit of a simple question.<br>
<br>
I have created a script in the processing toolbox and it opens a dialogue box when you double click on it (as you would expect). Given that many users may not understand or even open the processing toolbox I want to trigger the script using a button in my custom
 plugin.<br>
<br>
I know you can use processing.run(script/model, parameters) but I don't know the parameters and I don't want to recreate the dialogue box in my plugin.<br>
<br>
Is there a python command to simply trigger/open a process to run (replicate clicking on it in the toolbox)?<br>
<br>
Thanks,<br>
Paul<br>
This e-mail and any files transmitted with it are intended solely for the use of the individual or entity to whom they are addressed. It may contain unclassified but sensitive or protectively marked material and should be handled accordingly. Unless you are
 the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All traffic may be subject to recording and/or
 monitoring in accordance with relevant legislation. Any views expressed in this message are those of the individual sender, except where the sender specifies and with authority, states them to be the views of Dorset Council. Dorset Council does not accept
 service of documents by fax or other electronic means. Virus checking: Whilst all reasonable steps have been taken to ensure that this electronic communication and its attachments whether encoded, encrypted or otherwise supplied are free from computer viruses,
 Dorset Council accepts no liability in respect of any loss, cost, damage or expense suffered as a result of accessing this message or any of its attachments. For information on how Dorset Council processes your information, please see
<a href="http://www.dorsetcouncil.gov.uk/416433" target="_blank">www.dorsetcouncil.gov.uk/416433</a><br>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<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" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><o:p></o:p></p>
</blockquote>
</div>
</div>
This e-mail and any files transmitted with it are intended solely for the use of the individual or entity to whom they are addressed. It may contain unclassified but sensitive or protectively marked material and should be handled accordingly. Unless you are
 the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All traffic may be subject to recording and/or
 monitoring in accordance with relevant legislation. Any views expressed in this message are those of the individual sender, except where the sender specifies and with authority, states them to be the views of Dorset Council. Dorset Council does not accept
 service of documents by fax or other electronic means. Virus checking: Whilst all reasonable steps have been taken to ensure that this electronic communication and its attachments whether encoded, encrypted or otherwise supplied are free from computer viruses,
 Dorset Council accepts no liability in respect of any loss, cost, damage or expense suffered as a result of accessing this message or any of its attachments. For information on how Dorset Council processes your information, please see www.dorsetcouncil.gov.uk/416433
</body>
</html>