Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
General

General

Does Mechanical pass the ‘Strings’ (Ex. file name) as an Input Arguments into macros?

    • FAQFAQ
      Participant

      The Mechanical GUI does not support passing strings into macros. The workaround would be to name the files such that they end with a number such as: file1,csv file2,csv file3,csv then pass the number in as arg1. The macro should be written to use file%arg1%,csv and there cannot be spaces in the path or filename. For example following macro will read data from file1.csv into table HGEN1. /INQUIRE,numlines,LINES,’D:ProjectFEA_1file%arg1%’,’csv’ rownum=numlines *dim,HGEN1,table,(rownum-1),(5-1) *tread,HGEN1,’D:ProjectFEA_1file%arg1%’,’csv’