Thanks Jon, now I&#39;m more clear, <br><br>I think working with the text mode and calling the menus with their characters should be more than enough.<br>But specifically, how do you call that commands with Perl (or the C shell)? could you give me a short example?<br>

For example, how write and run a script that draws a thermal zone and place a goup of windows with a for loop.<br><br>I&#39;m working in something like this:<br>-create one 10x10x10m zone, <br>
-place one 1x1m window, <br>
-simulate and read the thermal data, <br>
-move the window 1m in a random direction<br>-simulate, and if better maintaind or else go back.<br><br>The idea is to automatize this algorithmic process in order to increase its complexity later, but I&#39;m stuck at the basics. <br>

I&#39;ll take a look to the developers API, I&#39;m looking for a software flexible enough to code some
small procedures combining geometric changes &amp;
simulation/evaluation and ESP-r looks perfect.<br><br>Regards<br><br>Victor<br><br><br><br><br><br><div class="gmail_quote">On Wed, Jul 28, 2010 at 4:21 AM, Jon Hand <span dir="ltr">&lt;<a href="mailto:jon@esru.strath.ac.uk">jon@esru.strath.ac.uk</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
There is perhaps a misunderstanding about how scripts drive esp-r modules.<br>
<br>
ESP-r modules can be invoked in a text-only mode and each of the menus that<br>
would normally be seen in the graphic mode are selected by a single character.<br>
Essentially, if you can do a task in ESP-r manually what you want to do is<br>
to capture the sequence of key strokes you used and embed them in a script.<br>
<br>
These scripts are not invoking a &#39;method&#39;, they are navigating the interface and<br>
driving the interface to do a specific task (which should work as long as the interface<br>
does not change).<br>
<br>
So first become familiar with the ESP-r interface.  It is possible to create a model<br>
from scratch via commands and it is possible to take an existing model and<br>
alter aspects of the model via commands.  And before going to all of that trouble<br>
it would be useful to consider what the other options are.<br>
<br>
There is a so-called META file which is a somewhat compact text file that some 3rd party<br>
software uses to pass information about building to ESP-r.<br>
<br>
The ESP-r Developers Guide includes an API for ~hundred subroutines and lots of<br>
other information that might be helpful to you.<br>
<br>
What is unclear is the big picture of what it is you are trying to do and your goals.<br>
If you could provide an outline then it might focus the discussion.<br>
<br>
-Jon Hand<br>
________________________________________<br>
From: victor bunster [<a href="mailto:victorbunster@gmail.com">victorbunster@gmail.com</a>]<br>
Sent: 28 July 2010 01:34<br>
To: Aizaz Samuel<br>
Cc: <a href="mailto:esp-r@lists.strath.ac.uk">esp-r@lists.strath.ac.uk</a>; David Garcia; Jon Hand<br>
Subject: Re: [esp-r] Re: Perl script<br>
<div class="im"><br>
Thanks for all the feedback, its helping me a lot.<br>
<br>
I have a couple of more basic questions, I&#39;m not used to ESP-r scripting &quot;environment&quot; (I come from other software with embedded scripting functionality, like ecotect or rhino). I have noticed that many of the scripts use the C:\ shell, but I have a couple of problems to advance in that path.<br>


First, I don&#39;t know how to run the software&#39;s commands, is there any document with the methods or an API guide? for example if I want to create a zone, how do I call that method from inside the shell?<br>
The other question regards the possibility to write longer code, for example: create a zone, then 10 windows, assign material, etc... all in one block. I think this should be done in Perl (or Python) but I don&#39;t know how to run it and connected to ESP-r methods.<br>


<br>
Thanks again,<br>
<br>
Victor<br>
<br>
<br>
<br>
</div><div class="im">On Tue, Jul 27, 2010 at 8:40 PM, Aizaz Samuel &lt;<a href="mailto:aizaz.a.samuel@strath.ac.uk">aizaz.a.samuel@strath.ac.uk</a>&lt;mailto:<a href="mailto:aizaz.a.samuel@strath.ac.uk">aizaz.a.samuel@strath.ac.uk</a>&gt;&gt; wrote:<br>


Some instances where scripts have been used in the past:<br>
1. ESP-r modelling of domestic heating systems (ADEPT2 available from<br>
</div><a href="http://sesg.strath.ac.uk" target="_blank">sesg.strath.ac.uk</a>&lt;<a href="http://sesg.strath.ac.uk" target="_blank">http://sesg.strath.ac.uk</a>&gt;) has scripts that simulate and list the results into csv<br>


<div><div></div><div class="h5">files that are readable by spreadsheet macros.<br>
2. Simulation of test models that simulate and write out results in pdf<br>
format. These are used for running comparison tests periodically and writing<br>
out a nicely formatted report.<br>
3. Running regression testing that involves subversion commands, forcheck,<br>
compilation, simulation, results analysis and some other software testing<br>
tasks. (Available at<br>
<a href="https://espr.svn.cvsdude.com/esp-r/trunk/tester/scripts/" target="_blank">https://espr.svn.cvsdude.com/esp-r/trunk/tester/scripts/</a>)<br>
<br>
The first two use bash and c shell scripts the last one uses perl<br>
<br>
Regards,<br>
--<br>
Dr Aizaz A Samuel<br>
Department of Mechanical Engineering<br>
University of Strathclyde<br>
M324 James Weir Building<br>
75 Montrose Street<br>
Glasgow, UK<br>
G1 1XJ<br>
<br>
T:+44 141 548 5765<br>
F:+44 141 552 5105<br>
<br>
<br>
On Tuesday 27 July 2010 10:57, David Garcia wrote:<br>
&gt; Normally it should be perl but other users told me that python is more<br>
&gt; useful,<br>
&gt;<br>
&gt; Personaly I used PERL, to start programming, I recommend you to read the<br>
&gt; book &quot;Learning Perl&quot; from Randal L.Schwartz,(O&#39;reilly).<br>
&gt;<br>
&gt; Normally your perl file should look like this: (FOR YOUR CHANGE GEOMETRY<br>
&gt; SECTION)<br>
&gt;<br>
&gt; --------------------------------------------------------------<br>
&gt; $file = $ARGV[0];<br>
&gt; $largo = $ARGV[1];<br>
&gt; $ancho = $ARGV[2];<br>
&gt; $alto = $ARGV[3];<br>
&gt; $angulo = $ARGV[4];<br>
&gt; $base = $largo*$ancho;<br>
&gt;<br>
&gt; # Parse the perl sign pound (#)<br>
&gt; $val = &quot;#&quot;;<br>
&gt;<br>
&gt; # open up MYFILE for writing<br>
&gt; open(MYFILE,&quot;&gt;$file&quot;);<br>
&gt;<br>
&gt; #or die &quot;Can&#39;t open up myfile: $file\n&quot;; if we want the file to be readed!<br>
&gt;<br>
&gt; # now this line format will automatically apply to MYFILE<br>
&gt; format MYFILE =<br>
&gt; @&lt;geometry of test_zonep defined in: ../zones/test_zonep.geo<br>
&gt; $val<br>
&gt; GEN  test_zonep  test_zonep describes a for testing in perl  # type, name,<br>
&gt; descr 8       6   @###.###    # vertices, surfaces, rotation angle $angulo<br>
&gt; @&lt; X co-ord, Y co-ord, Z co-ord<br>
&gt; $val<br>
&gt;       0.00000     0.00000     0.00000  # vert   1<br>
&gt;    @###.#####     0.00000     0.00000  # vert   2<br>
&gt;     $largo,<br>
&gt;    @###.#####  @###.#####     0.00000  # vert   3<br>
&gt;     $largo,   $ancho<br>
&gt;       0.00000  @###.#####     0.00000  # vert   4<br>
&gt;           $ancho  .... CONTINUE<br>
&gt; ----------------------------------<br>
&gt;<br>
&gt; and you can invoke it in linux by type:<br>
&gt;<br>
&gt;<br>
</div></div>&gt; ./<a href="http://changegeo.pl" target="_blank">changegeo.pl</a>&lt;<a href="http://changegeo.pl" target="_blank">http://changegeo.pl</a>&gt;&lt;<a href="http://changegeo.pl" target="_blank">http://changegeo.pl</a>&gt; ARGV1 ARGV2 ARGV3<br>


<div class="im">&gt;<br>
&gt; then for your SIMULATE option check the cookbook for runing espr in text<br>
&gt; mode.<br>
&gt;<br>
&gt; you can so do a for in a bash file, and then take out the value you are<br>
&gt; interested with &quot;awk&quot; (a language like perl) using this command: (FOR YOUR<br>
&gt; EVALUATE SECTION)<br>
&gt;<br>
&gt; awk &#39;/Totals/ {print $2 &quot;\n&quot;}&#39; prueba$i.cfg.wc_res.data &gt; TOTAL<br>
&gt;<br>
&gt; then put your statement<br>
&gt;<br>
&gt; if Total == ValueYouWant<br>
&gt;<br>
&gt; Exit for<br>
&gt;<br>
&gt; and then voilà! :)<br>
&gt;<br>
&gt; Is a little bit rudimentary but I hope this could help you.<br>
&gt;<br>
&gt; Regards<br>
&gt;<br>
&gt; --<br>
&gt; David GARCIA SANCHEZ<br>
&gt; ------------------------------------------------------------<br>
&gt; Département Systèmes Énergétiques Environnement<br>
&gt; Ecole des Mines de Nantes<br>
&gt; 4, Rue Alfred Kastler<br>
&gt; 44300 Nantes<br>
&gt; France<br>
&gt; ------------------------------------------------------------<br>
</div>&gt; Email: <a href="mailto:david.garcia-sanchez@emn.fr">david.garcia-sanchez@emn.fr</a>&lt;mailto:<a href="mailto:david.garcia-sanchez@emn.fr">david.garcia-sanchez@emn.fr</a>&gt;&lt;mailto:<a href="mailto:david.garcia-sanchez@emn.fr">david.garcia-sanchez@emn.fr</a>&lt;mailto:<a href="mailto:david.garcia-sanchez@emn.fr">david.garcia-sanchez@emn.fr</a>&gt;&gt;<br>


<div><div></div><div class="h5">&gt; Tel: +33 (0) 2 51 85 82 14<br>
&gt; Mobile: +33 (0) 6 78 15 08 09<br>
&gt; Fax: +33 (0) 2 51 85 82 99<br>
&gt; ------------------------------------------------------------<br>
<br>
</div></div></blockquote></div><br>