0

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.

Foad S. Farimani
  • 12,396
  • 15
  • 78
  • 193
koolraj09
  • 13
  • 2
  • 7

1 Answers1

0

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.

  • Why did you use the `/SYP` while you could use the native APDL command `/MKDIR, Dir`? more info [here](https://www.mm.bme.hu/~gyebro/files/ans_help_v182/ans_cmd/Hlp_C_MKDIR.html). – Foad S. Farimani May 28 '22 at 00:26
  • Good question. I probably didn't better back then :) Now that I read the question again, shouldn't the author just change working directory and then continue save, solve etc.? – Pavel Urubcik Mar 31 '23 at 07:00