3D Design

3D Design

Import non-standard python packages in Spaceclaim’s scripting

    • Tom Teschner
      Subscriber

      I'm currently playing around with Spaceclaim's scripting capabilities, given that this is in Python, I have a few ideas I want to test but would need to import a few non-standard packages for that. My question is thus if it is possible to install additional packages in spaceclaim? I have tried to drop the package folder inside C:\Program Files\ANSYS Inc\v222\scdm\Library\IronPython\Lib which is then recognised in the script editor (i.e. intelissense is picking it up) but this route does not seem to work (possibly as my package is designed to work with Python 3.6 and newer and spaceclaim seemingly using Python version 2.7.4).

      If this approach ought to work but the issues I am facing are due to an outdated Python version, is there a way to upgrade the python version within spaceclaim to the latest Python version?

      Edit: I just realised that "IronPython" is not standard Python, reading up on IronPython, it seems what I want to achieve is not possible with IronPython (i.e. there is no support for the packages I am looking at). Too bad. But if there is a way to upgrade the IronPython version, that would still be of interest to me.

    • Vinayak Vipradas
      Ansys Employee

      Hi Tom, 

      If you are using 2022 R1, then it depends on both IronPython 2 and Python 3.7.11 and upgrading or uninstalling either would have unpredictable effects on the softwares performance. The latest version of Python is not compatible with Spaceclaim.
      Which supporting packages are you looking for importing? Because only IronPython compatible modules (i.e., pure Python with no C code involved) will work. This is a limitation of IronPython in general. 


      Regards, 

      Vinayak Vipradas

    • Tom Teschner
      Subscriber

      I am using 2022R2, any chance I can use Python 3.7.11 within the scripting editor as well, or just IronPython? I could also upgrade to version 2023R1 if that changes anything (I haven't checked).

      There are a few modules I am interested in but indee dsome of them are using C so that is probably why dragging and dropping them into the Lib folder did not work. Though I think at least some of these should be available by default in Python 3.7.11 so if there is a chance to use that instead that would already help using at least a few of these.

    • Vinayak Vipradas
      Ansys Employee

      Python 3.7.11 is compatible with 2022R2.
      If you have a local version of upgraded IronPython, you can try to use its pip to pull in the libraries you need. 

       

    • Tom Teschner
      Subscriber

      that's a good point, I will try. Just to confirm, version 2022 R1 would work with Python 3.7.11 or am I misinterpreting this?

    • Vinayak Vipradas
      Ansys Employee

      Yes, Python 3.7.11 should work with 2022R1. Please let me know if you have any trouble. 

Viewing 5 reply threads
  • You must be logged in to reply to this topic.