ANSYS: Change working directory while executing a macro

7.6k views Asked by At

I have a macro which creates a new folder in the current working directory while running it. Now what I want to do is as soon as the macro creates the new folder in the working directory, all the further files including .db and .rst should be saved to this new folder. I tried the save command but somehow it is not working.

Any help is appreciated. Thanks.

1

There are 1 answers

2
Pavel Urubcik On

Worked for me in ANSYS 15.0. Assuming you're talking about ANSYS APDL ("clasic").

/SYP,mkdir ,'mytest'  ! Create new working directory in the current WD
/CWD,'C:\default_workdir\mytest'   ! Change WD to the new one
save   ! save .db

If it doesn't work then simly issue all SAVE commands with specification of full path: SAVE, Fname, Ext Read the ANSYS Help Doucmentation. It is a good one.