|
[Sponsors] |
July 15, 2009, 13:37 |
command editor
|
#1 |
New Member
Join Date: Jul 2009
Posts: 6
Rep Power: 17 |
Hi all,
I am trying to create some sessions of my own in the command editor, but I do not know the commands and some general stuff… 1) Is there a command like Fortran’s “do”? 2) for example I wrote : DATA READER: CASE:Case 50_202pN_001 DOMAIN:Apomastefsi S3 Components to Ignore = Apomastefsi S3 Components to Update = END END END This works fine. But when I load a different case which means different case name (“Case 50_202pN_001” ), then as expected there are errors! I tried to replace the “Case 50_202pN_001” with “$case” but it didn’t work. Is there a way to bypass this problem? Is there a way to make these lines compatible with ANY case without changing the case name manually? Thanks a lot fkonias |
|
July 15, 2009, 13:52 |
|
#2 |
New Member
Join Date: Mar 2009
Posts: 16
Rep Power: 17 |
Hi,
I'm not familiar with 'CASE' but the following should let you loop through a series of commands for a list of different files (I've assumed that 'Case 50_202pN_001' is a res file). Code:
!foreach $case('Case 50_202pN_001.res', ...) !{ DATA READER: CASE:$case DOMAIN:Apomastefsi S3 Components to Ignore = Apomastefsi S3 Components to Update = END END END !} To create your own session file, I think the best bet is to record one in POST and then edit it in a command editor. This will allow you to see the commands and then you can just tweak it with your own variables and loops, etc. I learned a little bit of the coding required to make my own session files through ANSYS training, so I'm not familiar with what content is in the documentation, but I'm sure you'll find some. Hope this helps a bit. |
|
July 16, 2009, 09:56 |
|
#3 |
New Member
Join Date: Jul 2009
Posts: 6
Rep Power: 17 |
Thank you for your replay, but I am not quite sure how to use this!
It looks like it’s a kind of a loop, which is repeated for all ‘things’ in the parenthesis. Am I right? Well this is something else that I might be able to use somewhere else, but it’s not what I was looking for this time. I just want to replace “Case 50_202pN_001” with a “skeleton key”. Like when we write *.* if that is possible. |
|
July 16, 2009, 20:31 |
|
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,850
Rep Power: 144 |
Hi,
The for loop in LKF's example is a perl script. CFX supports perl in some of its transcript files. Read the documentation on scripting in CFX or look at the web for references on perl such as http://www.perl.org/ Glenn Horrocks |
|
July 21, 2009, 23:47 |
|
#5 |
Senior Member
Jack
Join Date: Mar 2009
Posts: 106
Rep Power: 16 |
a good book: R. Schwartz and T. Phoenix, Learning Perl, Ed. O'Reilly. At Amazon dot com:
http://www.amazon.com/Learning-Perl-...8230978&sr=8-1 |
|
|
|