<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"><title></title><meta name="GENERATOR" content="OpenOffice.org 3.0 (Win32)"><style type="text/css">
        <!--
                @page { margin: 2cm }
                P { margin-bottom: 0.21cm }
        -->
        </style>
<p style="margin-bottom: 0cm;">Thanks for all the feedback, its
helping me a lot.</p><p style="margin-bottom: 0cm;"><br>I have a couple of more basic questions, I'm not
used to ESP-r scripting "environment" (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't know
how to run the software'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't know how to run it and connected to
ESP-r methods.</p>
<p style="margin-bottom: 0cm;">
</p>
<p style="margin-bottom: 0cm;">Thanks again,</p>
<p style="margin-bottom: 0cm;">Victor</p>
<br><br><br><div class="gmail_quote">On Tue, Jul 27, 2010 at 8:40 PM, Aizaz Samuel <span dir="ltr"><<a href="mailto:aizaz.a.samuel@strath.ac.uk">aizaz.a.samuel@strath.ac.uk</a>></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;">
Some instances where scripts have been used in the past:<br>
1. ESP-r modelling of domestic heating systems (ADEPT2 available from<br>
<a href="http://sesg.strath.ac.uk" target="_blank">sesg.strath.ac.uk</a>) has scripts that simulate and list the results into csv<br>
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>
<div><div></div><div class="h5"><br>
<br>
On Tuesday 27 July 2010 10:57, David Garcia wrote:<br>
> Normally it should be perl but other users told me that python is more<br>
> useful,<br>
><br>
> Personaly I used PERL, to start programming, I recommend you to read the<br>
> book "Learning Perl" from Randal L.Schwartz,(O'reilly).<br>
><br>
> Normally your perl file should look like this: (FOR YOUR CHANGE GEOMETRY<br>
> SECTION)<br>
><br>
> --------------------------------------------------------------<br>
> $file = $ARGV[0];<br>
> $largo = $ARGV[1];<br>
> $ancho = $ARGV[2];<br>
> $alto = $ARGV[3];<br>
> $angulo = $ARGV[4];<br>
> $base = $largo*$ancho;<br>
><br>
> # Parse the perl sign pound (#)<br>
> $val = "#";<br>
><br>
> # open up MYFILE for writing<br>
> open(MYFILE,">$file");<br>
><br>
> #or die "Can't open up myfile: $file\n"; if we want the file to be readed!<br>
><br>
> # now this line format will automatically apply to MYFILE<br>
> format MYFILE =<br>
> @<geometry of test_zonep defined in: ../zones/test_zonep.geo<br>
> $val<br>
> GEN test_zonep test_zonep describes a for testing in perl # type, name,<br>
> descr 8 6 @###.### # vertices, surfaces, rotation angle $angulo<br>
> @< X co-ord, Y co-ord, Z co-ord<br>
> $val<br>
> 0.00000 0.00000 0.00000 # vert 1<br>
> @###.##### 0.00000 0.00000 # vert 2<br>
> $largo,<br>
> @###.##### @###.##### 0.00000 # vert 3<br>
> $largo, $ancho<br>
> 0.00000 @###.##### 0.00000 # vert 4<br>
> $ancho .... CONTINUE<br>
> ----------------------------------<br>
><br>
> and you can invoke it in linux by type:<br>
><br>
><br>
</div></div>> ./<a href="http://changegeo.pl" target="_blank">changegeo.pl</a><<a href="http://changegeo.pl" target="_blank">http://changegeo.pl</a>> ARGV1 ARGV2 ARGV3<br>
<div class="im">><br>
> then for your SIMULATE option check the cookbook for runing espr in text<br>
> mode.<br>
><br>
> you can so do a for in a bash file, and then take out the value you are<br>
> interested with "awk" (a language like perl) using this command: (FOR YOUR<br>
> EVALUATE SECTION)<br>
><br>
> awk '/Totals/ {print $2 "\n"}' prueba$i.cfg.wc_res.data > TOTAL<br>
><br>
> then put your statement<br>
><br>
> if Total == ValueYouWant<br>
><br>
> Exit for<br>
><br>
> and then voilà! :)<br>
><br>
> Is a little bit rudimentary but I hope this could help you.<br>
><br>
> Regards<br>
><br>
> --<br>
> David GARCIA SANCHEZ<br>
> ------------------------------------------------------------<br>
> Département Systèmes Énergétiques Environnement<br>
> Ecole des Mines de Nantes<br>
> 4, Rue Alfred Kastler<br>
> 44300 Nantes<br>
> France<br>
> ------------------------------------------------------------<br>
</div>> Email: <a href="mailto:david.garcia-sanchez@emn.fr">david.garcia-sanchez@emn.fr</a><mailto:<a href="mailto:david.garcia-sanchez@emn.fr">david.garcia-sanchez@emn.fr</a>><br>
<div><div></div><div class="h5">> Tel: +33 (0) 2 51 85 82 14<br>
> Mobile: +33 (0) 6 78 15 08 09<br>
> Fax: +33 (0) 2 51 85 82 99<br>
> ------------------------------------------------------------<br>
</div></div></blockquote></div><br>