Strings Argument Support in Command Objects — Lesson 5

Does Mechanical software pass the “Strings” (e.g., file name) as an input argument into macros?

The Mechanical GUI does not support passing strings into macros. The workaround would be to name the files so that they end with a number, such as:

file1.csv
file2.csv
file3.csv

then paste the number in as arg1. The macro should be written to use file%arg1%.csv, and there cannot be spaces in the path or file name. For example, the following macro will read data from file1.csv into table HGEN1.

/INQUIRE,numlines,LINES,'D:\Project\FEA_1\file%arg1%','csv'
rownum=numlines
*dim,HGEN1,table,(rownum-1),(5-1)
*tread,HGEN1,'D:\Project\FEA_1\file%arg1%','csv'