Ansys Learning Forum › Forums › Discuss Simulation › General Mechanical › Getting type string data from Mechanical script to APDL Command Snippets (via ARGs or otherwise) › Reply To: Getting type string data from Mechanical script to APDL Command Snippets (via ARGs or otherwise)
February 17, 2022 at 1:08 pm
Erik Kostson
Ansys Employee
Hi
We can not put a text as an argument (ARG1 say).
One workaround is to print with ACT the named selection to a text file and then read that text file with apdl (see perhaps TREAD and *DIM command on how to read in a text file). Then you will have access to all the names in a table (*DIM).
Another way is to use just apdl commands to get the named selections since they are defined in the ds.dat as components (CM). These commands are relevant to get the total number of components and the name of the first and second one.
*GET,mycm, COMP, 0,NCOMP *GET, myfcm,COMP, 1,NAME
*GET, myscm,COMP, 2,NAME
All the best
Erik
We can not put a text as an argument (ARG1 say).
One workaround is to print with ACT the named selection to a text file and then read that text file with apdl (see perhaps TREAD and *DIM command on how to read in a text file). Then you will have access to all the names in a table (*DIM).
Another way is to use just apdl commands to get the named selections since they are defined in the ds.dat as components (CM). These commands are relevant to get the total number of components and the name of the first and second one.
*GET,mycm, COMP, 0,NCOMP *GET, myfcm,COMP, 1,NAME
*GET, myscm,COMP, 2,NAME
All the best
Erik