IronPython 2.7 for Dynamo

can anybody try to use different functions from another version of python inside the dynamo?

for example
scipy , numpy
e.t.c.

or we can use only IronPython 2.7 functions in Dynamo?

1 Like

There are a few initiatives that target running CPython from Rhino/Grasshopper/IronPython (i.e. enabling one to implement numpy/scipy), which one might build a similar Dynamo implementation from. I haven’t really messed with either one, but there certainly are considerable dependencies and plumbing involved, making it less than straightforward:

  1. https://github.com/Digital-Structures/ghpythonremote

  2. https://github.com/MahmoudAbdelRahman/GH_CPython

An alternative (and arguably simpler) approach would be to implement an equivalent .NET library. In this case, for instance Math.NET.

2 Likes

Hi @til.shviger
You cant use numpy or other things that isnt IronPython modules. If it is needed, then you need to call the Python environment and work outside the dynamo environment and return the results to Ironpython again.

this is a proof of concept from @Tomasz

…and by doing that you also can use Python 3.6

5 Likes

@erfajo
Thanks a lot !

That’s very interesting.

and @Tomasz if you see this message )
maybe you’ve already used a real example in your work?

Actually I still haven’t used that method. Anyway, what is your goal?

i would like to use possibilities of another versions python

for example
scipy , numpy
e.t.c.

@til.shviger,

I have to say that I have also given up about IronPython and asking for better support to ex. Python 3.6. I have started to move my package to ZeroTouch nodes and .net… It is so much easier to move from the IronPython/Python 2.7 environment to .net than it is to upgrade/use Python 3.6 in Dynamo.

2 Likes

@erfajo

am I right to understand that the best way to work in Dynamo is to use libraries from NET ?

I am very satisfied with Python, but being dependent to IronPython 2.7.3 is too limited. By converting to .net you enter a complete coding environment where you can decide what to include.
For easy list traversing I will continue using Python, since it is so easy… but for things that should be included in my package will I convert to .net

2 Likes

just curious if you guys have played with @Dimitar_Venkov’s awesome package for interpreting c# code?

@erfajo
what are you use to convert some things to .net ? its work inside Dynamo (Python) or inside MicrosoftVisualStudio or another programms?

one thing I have always wanted to try is to compile the ironpython code to a dll - which you can actually do - since it emits IL anyway (IntermediateLanguage) then using something like IL spy you can convert that IL back to c#…

1 Like