Grancha
Industrial
- Aug 19, 2011
- 9
I'm trying to save a bitmap of the ANSYS screen using /IMAGE each time a loop in my program runs. I would like to use a couple of variable values in the filename so the correct image can be found later. The following code does exactly that, but causes an error dialog box to appear, meaning the code will not run through without user intervention every loop:
/IMAGE,SAVE,%var1%_%var2%,bmp,
where var1 and var2 are the variable names (doubles).
The error reads "Missing separator between fields", but the images are saved correctly, and as long as the error messages are dismissed each loop the code runs correctly.
As a workaround I tried saving the variables as strings first, then concatenating them as below, however this does not work and I think it is because the way I am converting the numbers to strings is incorrect:
str1 = %var1%
str2 = %var2%
str3 = strcat(str1,str2)
/IMAGE,SAVE,str3,bmp,
What is the best way to convert numbers to strings in APDL?
/IMAGE,SAVE,%var1%_%var2%,bmp,
where var1 and var2 are the variable names (doubles).
The error reads "Missing separator between fields", but the images are saved correctly, and as long as the error messages are dismissed each loop the code runs correctly.
As a workaround I tried saving the variables as strings first, then concatenating them as below, however this does not work and I think it is because the way I am converting the numbers to strings is incorrect:
str1 = %var1%
str2 = %var2%
str3 = strcat(str1,str2)
/IMAGE,SAVE,str3,bmp,
What is the best way to convert numbers to strings in APDL?