General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

Change working directory, solve and save files?

    • manuel.uruena
      Subscriber

      Dear all,

      I am running APDL in Python with mapdl for a stub column test. Every time I run my code in Python, all files created at the solution are saved into a temporary file created each time in AppData/Local with a different name. I need to call some of these saved files (file.rst, database.db) in my code, so I try to change the working directory for Python and for APDL by the /CWD command. But when I change my working directory, it no longer solves and displays this error:

      Traceback (most recent call last):

       File "", line 1, in

       File "C:UsersMANUELAppDataLocalProgramsPythonPython37libsite-packagesansysmapdlcore\_commandssolutionanalysis_options.py", line 3277, in solve

        return self.run(command, **kwargs)

       File "C:UsersMANUELAppDataLocalProgramsPythonPython37libsite-packagesansysmapdlcoremapdl.py", line 1898, in run

        text = self._run(command, **kwargs)

       File "C:UsersMANUELAppDataLocalProgramsPythonPython37libsite-packagesansysmapdlcoremapdl_corba.py", line 334, in _run

        text = self._server.executeCommandToString(command)

       File "C:UsersMANUELAppDataLocalProgramsPythonPython37libsite-packagesansys_corbaICoMapdlUnit_idl.py", line 206, in executeCommandToString

        return self._obj.invoke("executeCommandToString", _0_AAS_CORBA.MAPDL.Solvers.ICoMapdlUnit._d_executeCommandToString, args)

      AAS_CORBA.MAPDL.Exceptions.EAnsysUnknown: AAS_CORBA.MAPDL.Exceptions.EAnsysUnknown(code=-15, description='Low-level communication error -15: Connection was closed', scope='MAPDL', interfaceName='ICoMapdlUnit', operation='executeCommand', moreInfo='SOLVE,')


      How can I change the working directory and solve the model without this error?

    • mrife
      Ansys Employee
      Hi @muruep it seems that you are using PyMAPDL...is that correct? If so what version of MAPDL and PyMAPDL are you using? What was the exact command issued? And what is the path you are using for the new working directory?

      Mike
    • manuel.uruena
      Subscriber
      Yes, I solved it with the command:

      mapdl = launch_mapdl(run_location='C:\\APDL')

      Thanks
    • mrife
      Ansys Employee
      Hi @muruep please provide the version of PyMAPDL and MAPDL that you are using.
      MIke
Viewing 3 reply threads
  • The topic ‘Change working directory, solve and save files?’ is closed to new replies.