I am trying to match FEA results with an experiment, wherein I need to match mode shapes and frequencies. I am testing different models, and I would like to parameterize several material properties.

It is easy to extract frequencies as a parameter, however since the mode shapes change with the material parameters, this is not terribly helpful. I thought that it would be a simple workaround to create an image of each deformation result, labeled with the parameter settings using an ADPL Command as output, however I have now spent two days on this and I am not much further.

My ideal solution would be to extract the images, with the parameter values (eg: "P=.5, Q=.1, Ez = 110MPa") as text within the image.

The farthest that I have gotten is to make an image object under the command in the model tree using the following:


However I cannot find this image file and I do not think that it is actually saved.

If there is another (more straightforward) way of obtaining these mode shapes, I am all ears!

Thank you.

  • $\begingroup$ Why not just retain the information from all your design points? Do you lack disk space? $\endgroup$
    – Orbit
    May 10, 2022 at 11:12
  • $\begingroup$ @Orbit No, retaining the information is not a problem. It is cycling through it for each of the mode shapes. Now that the mode shapes are saved as images, I am able to do so very quickly, and I can use OpenCV in Python to merge images for relatively easy error-checking. $\endgroup$
    – user109527
    May 16, 2022 at 10:21

2 Answers 2


After spending a great deal of time testing, and trying out different things, this is the code that ended up working:

!Commands inserted into this file will be executed immediately after the ANSYS /POST1 command.

!   Active UNIT system in Workbench when this object was created:  Metric (m, kg, N, s, V, A)
!   NOTE:  Any data that requires units (such as mass) is assumed to be in the consistent solver unit system.
!                See Solving Units in the help system for more information.

set,list,0   !This lists the attributes for the active set
*Get,nmds,ACTIVE,,SET,NSET   !This gets the number of modes

/DEV,PSFN,NINC   !This disables the incremental naming of image files (I think)

!All of these are string creations

! This convers the floats to shorter strings

!This creates a two-subplot plot for viewing modes from different angles

!This sets up a loop to save the images

!This selects the mode number from the set
/Dscale,ALL,0.1  !This sets the scale of the distortion

!This retrieves the frequency of the mode

!This produces the title on each image
/title, P=%P_%, Q=%Q_%, R = %R_%, Mode %i_%, %frq_%Hz

!j_ = i_-6

!This sets the viewpoint for each window (subplot)

!This instructs the plotter to create a .jpeg (PNGs did not work! This was one of the main problems that I was getting!)
PLDISP,0 !This requests a displacement plot
/show,close  !This closes the plot, so that the next one starts out fresh

!This was the most important bit. Renaming the image file so that each image is not overwritten!


You can try constructing your title like this:

P = CHRVAL(0.5)
Q = CHRVAL(0.1)
Ez = CHRVAL(110)

/title, P=%P%, Q=%Q%, Ez = %Ez%MPa

Padtinc did nice blogposts on APDL. Here is one on strings.

Than you can try saving plots with APDL to your user_files:

ii = strpos(aa(1),'dp')
ij = strpos(aa(ii+1),'')-1
dpn = strsub(aa(1),ii+1,ij)
dpn = strcat(dpn,'_')
/sys,copy *.png ......user_files

This was also taken from padinc's blog.

  • $\begingroup$ I am not certain why this did not work, but it did not. I think that it failed on two points: First, /show,png fails to produce a file to be copied. Second, the /sys command failed to copy files when a copy was made. $\endgroup$
    – user109527
    Apr 8, 2022 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.