pymechanical icon indicating copy to clipboard operation
pymechanical copied to clipboard

Add future APIs

Open koubaa opened this issue 1 year ago • 1 comments

Add the option to use scripting APIs developed in version N in pymechanical version <N.

This can be done by implementing the APIs directly in C# in some Ansys.Mechanical.Future namespace. The APIs can be implemented as extension methods and "installed" like this:

import clr
import sys

sys.path.append(r"path\to\future\dll")
clr.AddReference("Ansys.Mechanical.Future")
import Ansys
clr.ImportExtensions(Ansys.Mechanical.Future)
Model.SomeFutureAPI()

ImportExtensions is still not implemented in pythonnet, see https://github.com/pythonnet/pythonnet/issues/55, but for the remote sessions this can use IronPython- assuming that the assembly is copied to the machine where the remote instance is running. Fixing that issue in pythonnet or our fork would allow us to make use of this for embedded instances.

I have a reference implementation of the C# code built against ansys version 241 in this branch. This issue tracks adding that DLL to pymechanical, figuring out how to build it as part of the CI/CD, and the client side work to include that in embedding and remote sessions.

koubaa avatar Aug 04 '23 18:08 koubaa