<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Plaxis not starting remotly</title><link>https://communities.bentley.com/products/geotech-analysis/f/forum/204007/plaxis-not-starting-remotly</link><description>Hello, 
 I have prepared a Python script to accelerate routinely calculation in Plaxis. I would like it to open Plaxis and start executing the actions I have set in the script withou me having to open Plaxis, close the stat window and set the server manually</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Plaxis not starting remotly</title><link>https://communities.bentley.com/thread/712688?ContentTypeID=1</link><pubDate>Fri, 20 May 2022 07:17:28 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:55082182-8ef9-4a22-8b96-b1e46e71f9b9</guid><dc:creator>Stefanos Papavasileiou</dc:creator><description>&lt;p&gt;Hello Andres,&lt;/p&gt;
&lt;p&gt;Possibly you are trying to run the Python script using the python.exe from Spyder and not from PLAXIS. Therefore all the modules you are looking for are not present in the Python distribution Spyder provides (naturally).&lt;/p&gt;
&lt;p&gt;There are two options here:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You point Spyder to the PLAXIS Python Distribution. Via Spyder you can point to the&amp;nbsp;&lt;span&gt;PLAXIS Python Distribution, which by default for the CONNECT Edition is stored at (do not pick the internal one):&amp;nbsp;&lt;em&gt;C:\ProgramData\Bentley\Geotechnical&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;Look for the instructions for your IDE environment, or search online, like e.g. Spyder:
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/43592879/how-to-change-python-version-in-anaconda-spyder"&gt;stackoverflow.com/.../how-to-change-python-version-in-anaconda-spyder&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.quora.com/How-do-I-change-the-Python-version-in-Spider"&gt;www.quora.com/How-do-I-change-the-Python-version-in-Spider&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;You install the necessary modules on Spyder&amp;#39;s Python Distribution. You can read about it here:&lt;br /&gt;&lt;a href="/products/geotech-analysis/w/plaxis-soilvision-wiki/51822/how-to-install-additional-python-modules-in-plaxis"&gt;https://communities.bentley.com/products/geotech-analysis/w/plaxis-soilvision-wiki/51822/how-to-install-additional-python-modules-in-plaxis&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you still have problems, please submit a service request:&amp;nbsp;&lt;a href="https://apps.bentley.com/srmanager/ProductSupport"&gt;https://apps.bentley.com/srmanager/ProductSupport&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Plaxis not starting remotly</title><link>https://communities.bentley.com/thread/712636?ContentTypeID=1</link><pubDate>Thu, 19 May 2022 21:47:41 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:518bb960-0021-4ba0-b300-5aca7a413812</guid><dc:creator>Andr&amp;#233;s Gavidia</dc:creator><description>&lt;p&gt;Hello, sorry this code does not work for me, because it indicates -&amp;gt;&amp;nbsp;ModuleNotFoundError: No module named &amp;#39;plxscripting&amp;#39;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/343671/pastedimage1652996776378v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Plaxis not starting remotly</title><link>https://communities.bentley.com/thread/613734?ContentTypeID=1</link><pubDate>Mon, 12 Oct 2020 11:29:18 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:4e4219c3-bcdd-4c72-928d-07910a7b9722</guid><dc:creator>Joao Ferreira Verde</dc:creator><description>&lt;p&gt;Micha,&lt;/p&gt;
&lt;p&gt;Thank you. The code works well for me too.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Joao&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Plaxis not starting remotly</title><link>https://communities.bentley.com/thread/613355?ContentTypeID=1</link><pubDate>Fri, 09 Oct 2020 08:26:26 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:ea9c8d29-2ae0-4847-b6d9-0cd5e2459bfa</guid><dc:creator>Micha van der Sloot</dc:creator><description>&lt;p&gt;Hi Joao,&lt;/p&gt;
&lt;p&gt;In this case, it would be best to use the subprocess module.&lt;br /&gt;Also, it helps to add a small timeout for PLAXIS to launch and fetch the input server and global objects (s_i, g_i)&lt;/p&gt;
&lt;p&gt;This works for me:&lt;/p&gt;
&lt;div style="background:#ffffff;border:solid grey;border-width:.1em .1em .1em .8em;overflow:auto;padding:.2em .6em;width:auto;"&gt;
&lt;pre style="color:#000;font-family:&amp;#39;Lucida Console&amp;#39;,Consolas, Inconsolata,&amp;#39;DejaVu Sans Mono&amp;#39;, Monaco, &amp;#39;Courier New&amp;#39;, monospace;font-size:13px;line-height:120%;margin:5px;overflow:auto;padding:2px;white-space:pre;"&gt;&lt;span&gt;&lt;/span&gt;&lt;span style="color:#ff5600;"&gt;import&lt;/span&gt; &lt;span style="color:#000000;"&gt;subprocess&lt;/span&gt;
&lt;span style="color:#ff5600;"&gt;import&lt;/span&gt; &lt;span style="color:#000000;"&gt;os&lt;/span&gt;
&lt;span style="color:#ff5600;"&gt;from&lt;/span&gt; &lt;span style="color:#000000;"&gt;plxscripting.easy&lt;/span&gt; &lt;span style="color:#ff5600;"&gt;import&lt;/span&gt; &lt;span style="color:#ff5600;"&gt;*&lt;/span&gt;

&lt;span style="color:#000000;"&gt;inputport&lt;/span&gt; &lt;span style="color:#ff5600;"&gt;=&lt;/span&gt; 10000
&lt;span style="color:#000000;"&gt;plaxispw&lt;/span&gt;&lt;span style="color:#ff5600;"&gt;=&lt;/span&gt; &lt;span style="color:#00a33f;"&gt;r&amp;#39;YOURPASSWORD&amp;#39;&lt;/span&gt;
&lt;span style="color:#000000;"&gt;plaxis_path&lt;/span&gt; &lt;span style="color:#ff5600;"&gt;=&lt;/span&gt; &lt;span style="color:#00a33f;"&gt;r&amp;#39;C:\Program Files\Bentley\Geotechnical\PLAXIS 2D CONNECT Edition V20&amp;#39;&lt;/span&gt;
&lt;span style="color:#000000;"&gt;plaxis_input&lt;/span&gt; &lt;span style="color:#ff5600;"&gt;=&lt;/span&gt; &lt;span style="color:#00a33f;"&gt;&amp;#39;PLAXIS2DxInput.exe&amp;#39;&lt;/span&gt;

&lt;span style="color:#919191;font-style:italic;"&gt;# first launch PLAXIS&lt;/span&gt;
&lt;span style="color:#000000;"&gt;args&lt;/span&gt; &lt;span style="color:#ff5600;"&gt;=&lt;/span&gt; [&lt;span style="color: #000000;"&gt;os&lt;/span&gt;&lt;span style="color: #ff5600;"&gt;.&lt;/span&gt;&lt;span style="color: #000000;"&gt;path&lt;/span&gt;&lt;span style="color: #ff5600;"&gt;.&lt;/span&gt;&lt;span style="color: #000000;"&gt;join&lt;/span&gt;(&lt;span style="color: #000000;"&gt;plaxis_path&lt;/span&gt;, &lt;span style="color: #000000;"&gt;plaxis_input&lt;/span&gt;),
        &lt;span style="color: #00a33f;"&gt;"--AppServerPort={}"&lt;/span&gt;&lt;span style="color: #ff5600;"&gt;.&lt;/span&gt;&lt;span style="color: #000000;"&gt;format&lt;/span&gt;(&lt;span style="color: #000000;"&gt;inputport&lt;/span&gt;),
        &lt;span style="color: #00a33f;"&gt;"--AppServerPassWord={}"&lt;/span&gt;&lt;span style="color: #ff5600;"&gt;.&lt;/span&gt;&lt;span style="color: #000000;"&gt;format&lt;/span&gt;(&lt;span style="color: #000000;"&gt;plaxispw&lt;/span&gt;)]
&lt;span style="color:#000000;"&gt;inputprocess&lt;/span&gt; &lt;span style="color:#ff5600;"&gt;=&lt;/span&gt; &lt;span style="color:#000000;"&gt;subprocess&lt;/span&gt;&lt;span style="color:#ff5600;"&gt;.&lt;/span&gt;&lt;span style="color:#000000;"&gt;Popen&lt;/span&gt;(&lt;span style="color:#000000;"&gt;args&lt;/span&gt;)

&lt;span style="color:#919191;font-style:italic;"&gt;# then initialize the new_server with additional waiting time&lt;/span&gt;
&lt;span style="color:#919191;font-style:italic;"&gt;# due to startup of PLAXIS&lt;/span&gt;
&lt;span style="color:#000000;"&gt;s_i&lt;/span&gt;, &lt;span style="color:#000000;"&gt;g_i&lt;/span&gt; &lt;span style="color:#ff5600;"&gt;=&lt;/span&gt; &lt;span style="color:#000000;"&gt;new_server&lt;/span&gt;(&lt;span style="color:#00a33f;"&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt;, &lt;span style="color:#000000;"&gt;inputport&lt;/span&gt;, &lt;span style="color:#000000;"&gt;password&lt;/span&gt;&lt;span style="color:#ff5600;"&gt;=&lt;/span&gt;&lt;span style="color:#000000;"&gt;plaxispw&lt;/span&gt;, &lt;span style="color:#000000;"&gt;timeout&lt;/span&gt;&lt;span style="color:#ff5600;"&gt;=&lt;/span&gt;10.0)
&lt;span style="color:#000000;"&gt;s_i&lt;/span&gt;&lt;span style="color:#ff5600;"&gt;.&lt;/span&gt;&lt;span style="color:#000000;"&gt;new&lt;/span&gt;()

&lt;span style="color:#ff5600;"&gt;...&lt;/span&gt; &lt;span style="color:#000000;"&gt;add&lt;/span&gt; &lt;span style="color:#000000;"&gt;your&lt;/span&gt; &lt;span style="color:#000000;"&gt;code&lt;/span&gt; &lt;span style="color:#000000;"&gt;here&lt;/span&gt;

&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you want to open a second instance after this code is done&amp;nbsp;and&amp;nbsp;&amp;nbsp;closing PLAXIS, you can add this to the code to make sure PLAXIS Input is stopped:&lt;/p&gt;
&lt;div style="background:#ffffff;border:solid grey;border-width:.1em .1em .1em .8em;overflow:auto;padding:.2em .6em;width:auto;"&gt;
&lt;pre style="color:#000;font-family:&amp;#39;Lucida Console&amp;#39;,Consolas, Inconsolata,&amp;#39;DejaVu Sans Mono&amp;#39;, Monaco, &amp;#39;Courier New&amp;#39;, monospace;font-size:13px;line-height:120%;margin:5px;overflow:auto;padding:2px;white-space:pre;"&gt;&lt;span&gt;&lt;/span&gt;&lt;span style="color:#919191;font-style:italic;"&gt;## and to make sure PLAXIS is closed after the run:&lt;/span&gt;
&lt;span style="color:#919191;font-style:italic;"&gt;## Popen process .terminate()  this is a hard stop! nice closure of the project is recommended&lt;/span&gt;
&lt;span style="color:#000000;"&gt;s_i&lt;/span&gt;&lt;span style="color:#ff5600;"&gt;.&lt;/span&gt;&lt;span style="color:#000000;"&gt;close&lt;/span&gt;()
&lt;span style="color:#000000;"&gt;inputprocess&lt;/span&gt;&lt;span style="color:#ff5600;"&gt;.&lt;/span&gt;&lt;span style="color:#000000;"&gt;terminate&lt;/span&gt;()
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Alternatively, you can check if you opened PLAXIS already, and reuse the existing running PLAXIS application.&lt;/p&gt;
&lt;p&gt;Resources for Python/s subprocess module:&amp;nbsp;&lt;a href="https://docs.python.org/3.7/library/subprocess.html"&gt;https://docs.python.org/3.7/library/subprocess.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Plaxis not starting remotly</title><link>https://communities.bentley.com/thread/612967?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 08:52:03 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:2b0fe979-37a5-4c06-b1a8-aef0349ea75e</guid><dc:creator>Joao Ferreira Verde</dc:creator><description>&lt;p&gt;Hi Micha,&lt;/p&gt;
&lt;p&gt;Part of the porblem is solved with the line you suggested. I used the following lines in my Python script to start Plaxis remotly with password and port number (just as an example for very unexperienced users of Python as me).&lt;/p&gt;
&lt;p&gt;import os&lt;/p&gt;
&lt;p&gt;os.system(&amp;#39;cmd /k &amp;quot;C:\Program Files\Bentley\Geotechnical\PLAXIS 2D CONNECT Edition V20\Plaxis2DXInput.exe&amp;quot; --AppServerPassword=xxxxxxxxxxxxxxxx --AppServerPort=10000&amp;#39;)&lt;/p&gt;
&lt;p&gt;s_i.new()&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Although Plaxis starts, with the remote script configuration already set, it does not move out of the first empty window (see attached figure).&amp;nbsp; There is no error message returned in the Python command&amp;nbsp;window.&lt;/p&gt;
&lt;p&gt;To get out of the Plaxis empty window I have to manually clik &amp;#39;new button&amp;#39; but, other scripts that I prepared to build a Plaxis model do not run.&lt;/p&gt;
&lt;p&gt;I still have to manually open Plaxis and set the remote server connection manually and, only after that, I can run the Python scripts I have prepared.&lt;/p&gt;
&lt;p&gt;Do you have any suggestion to sort this problem?&lt;/p&gt;
&lt;p&gt;All the best,&lt;/p&gt;
&lt;p&gt;Joao&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/343671/Plaxis-_2D00_-start-window.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Plaxis not starting remotly</title><link>https://communities.bentley.com/thread/612547?ContentTypeID=1</link><pubDate>Mon, 05 Oct 2020 10:18:23 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:a1b92176-106b-459d-82d3-3fb412f84ecb</guid><dc:creator>Micha van der Sloot</dc:creator><description>&lt;p&gt;It is possible to start PLAXIS Input with specifying the port number and the password. So if you launch PLAXIS via the command line (or the Python &lt;em&gt;subprocess&lt;/em&gt; module)&lt;/p&gt;
&lt;p&gt;When using the remote scripting in an automated process, you can start the server without manual interaction&amp;nbsp;by launching your PLAXIS application with the AppServerPort and ApppServerPassword command line parameters.&lt;/p&gt;
&lt;p&gt;For example in order to&amp;nbsp;start the server in PLAXIS 2D on port 21403 using mypassword as the password:&lt;/p&gt;
&lt;pre&gt;C:\Program Files\Bentley\Geotechnical\PLAXIS 2D CONNECT Edition V20\PLAXIS2Dx.exe&amp;nbsp;--AppServerPassword=mypassword --AppServerPort=21403&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>