Configuring MS Visual Studio to Develop IronPython for ANSYS Scripting

drmgnewman
drmgnewman Member Posts: 2
Name Dropper First Comment
**
edited August 2023 in General Language Questions

Hi ANSYS Developer Community:

I would like to be able to develop IronPython code in Microsoft Visual Studio for scripting applications in ANSYS Spaceclaim, ANSYS Discovery, ANSYS Electronics Desktop, etc. Right now, it is unclear to me how to properly configure Microsoft Visual Studio to work with IronPython as oppsed to CPython so that I can develop IronPython applications in Visual Studio in the same way as other .NET languages such as C#, F#, Visual Basic, etc. I was wondering if someone in the ANSYS Developer Community could reach out to me to help me understand this? Thanks very much!

Answers

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee, GitHub-issue-creator Posts: 315
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    I have not tried it, because in VS you will not have access to the variables supplied through Ansys products. Instead, I recommend developing in the scripting window of the Ansys product. Alternatively, if you wish to run Ansys products externally, I recommend using PyAnsys https://developer.ansys.com/pyansys , which is compatible with CPython.

  • Chris Harrold
    Chris Harrold Member, Administrator, Employee Posts: 183
    100 Comments 5 Answers First Anniversary Ansys Employee
    admin

    Just as an addendum to the answer from @Landon Mitchell Kanner,  according to this post on https://visualstudio.comVisual Studio no longer supports IronPython. As the overall direction for Ansys is towards the external scripting of applications with APIs and Libraries, I would second his guidance and investigate the PyAnsys tools and make the shift to the CPython implementation they provide.

  • drmgnewman
    drmgnewman Member Posts: 2
    Name Dropper First Comment
    **

    Thank you Landon and Chris for your information! I did find another post in the ANSYS Developer Community at:

    I did get this to work for AEDT, but I just wonder if something similar to this could be done to do scripting for ANSYS Discovery and Spaceclaim within Visual Studio? The main difference is that AEDT scripting is based on ActiveX COM and the Discovery and Spaceclaim scripting is not.

    Thank you for letting me know that Microsoft will no longer support IronPython. I was told last year that Microsoft would no longer support ActiveX COM in favor of WCF (Windows Communication Foundation)? Have you heard this? If Microsoft will no longer support ActiveX COM or IronPython, what does ANSYS plan for the future of the scripting capabilities in AEDT, Discovery and Spaceclaim?

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee, GitHub-issue-creator Posts: 315
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    Our plan is to gradually migrate all product scripting to use CPython.