-
-
January 23, 2019 at 7:46 am
sohrab
SubscriberHi everyone,
i have dozens of developed codes in text and i want to run every code . how can i set APDL in such a way that starts from one code finish it and then start anaother code to analyze till end . it would hugely saves my time.
Â
thank you in advance for your replies and comments
Â
-
January 23, 2019 at 9:04 am
jj77
SubscriberÂ
Never done this, but should be perhaps possible. See these two very good posts on how to do something like that.
Â
In your case instead of running different parameters you do a *do loop that takes entries from a string array that contains all the mapdl macros/scripts file names.
http://www.padtinc.com/blog/tag/batch
Â
On how to create such an array see below:
http://www.padtinc.com/blog/the-focus/manipulating-text-strings-in-ansys-mechanical-apdl
-
January 23, 2019 at 10:32 am
sohrab
SubscriberThank you @jj77 for your reply.
i wrote a script as below
fini
/clear
*dim,ANNUM,string,80,17Â Â Â Â Â Â
ANTAG(1,1) = ‘AN1_SC’
ANTAG(1,2)=’AN1_DC’
ANTAG(1,3) = ‘AN2_SC’
ANTAG(1,4)=’AN2_DC’
ANTAG(1,5) = ‘AN3_SC’
ANTAG(1,6) = ‘AN4_SC’
ANTAG(1,7)=’AN4_DC’
ANTAG(1,= ‘AN5_SC’
ANTAG(1,9)=’AN5_DC’
ANTAG(1,10) = ‘AN6_SC’
ANTAG(1,11)=’AN6_DC’
ANTAG(1,12) = ‘AN7_SC’
ANTAG(1,13)=’AN7_DC’
ANTAG(1,14) = ‘AN8_SC’
ANTAG(1,15)=’AN8_DC’
ANTAG(1,16) = ‘AN9_SC’
ANTAG(1,17)=’AN9_DC’
!/INQUIRE,dir_,DIRECTORY
*do,I,1,17
*cfopen,%ANTAG(1,i)% ,mac
dirnam='%ANTAG(1,i)% '
*cfclose
/input,%ANTAG(1,i)%,mac
*enddo
but i get error (unknown expression in input file)
Â
Â
Â
-
January 23, 2019 at 10:56 am
jj77
SubscriberAs I said I have not done this myself. One thing I can see in the code though is that the array is called ANNUM, but then ANTAG is used (should be ANNUM I think). But I think it will not work still. I will have a look and see how one can add strings to an array.
-
January 23, 2019 at 11:15 am
jj77
Subscriberthis works:
*dim,ANTAG,CHAR,17
ANTAG(1,1) ='AN1_SC'
ANTAG(2,1) ='AN1_DC'
and so on
Â
Have in mind that CHAR are upto 8 characters long, but that is OK for you now.
Â
This should also work
size=17Â
*dim,mytext,char,sizeÂ
mytext(1)='hi'
mytext(2)='hiagain'
Â
-
January 23, 2019 at 11:36 am
sohrab
Subscriberthanks jj77 for the reply.i tried your code and still get the same error.Â
i copy and paste the script to the command bar in APDL, is it a correct approach?Â
-
January 23, 2019 at 11:47 am
jj77
SubscriberNot sure which part is not working. If we take the array part first, then take this and paste it in to the apdl command window on the top, that works.
*dim,ANTAG,CHAR,17
ANTAG(1,1) ='AN1_SC'
ANTAG(2,1) ='AN1_DC'
To see the values one can set a scalar s1=ANTAG(1,1) and look at s1.
See below:
If you mean that the whole script (running batch mode) does not work then I do not know why.
-
January 23, 2019 at 11:56 am
sohrab
Subscriberyour help is highly appreciated.
-
January 23, 2019 at 11:59 am
jj77
SubscriberNo worries, let us know if the script is not working and you can run batch and perhaps someone can help more (I will have a look also tomorrow when I have some more time)
-
January 23, 2019 at 8:14 pm
-
January 24, 2019 at 4:53 am
sohrab
SubscriberThnak you very much jj77 for your help it was useful. I appreciate it.
-
- The topic ‘APDL sequence of jobs in batch mode’ is closed to new replies.
-
3632
-
1313
-
1142
-
1068
-
1008
© 2025 Copyright ANSYS, Inc. All rights reserved.