Hello @WrightEngineering - We are adding a Migration Assistant that will help migrate your IronPython2 code to CPython3 The onus will be on the user to accept, or reject the proposed changes - and it wonât cover every single use case, but it should help save a lot of time and effort!
Beyond that Iâm not entirely sure Iâm reading your question correctly, but you can copy and paste existing Python code from Dynamo into other places, youâll just have to strip out the Dynamo specific pieces (i.e myVar = IN[0] / OUT = 0).
Hello @takumi_ban - Dynamo 2.7 is not yet released into the wild - As of today our latest stable build is Dynamo 2.6.1. Youâll be able to explore it in the Sandbox variant in the not-to-distant future and can download here: https://dynamobuilds.com/
As @jacob.small said, however, you will need to wait for Revit to natively update to this version as Dynamo is no longer an Addin, but a feature of Revit.
Thatâs wonderful! Thanks solamour. What I mean exactly with my question: is will we eventually be able to copy dynamo nodes into a Python format? for example: In ArcGIS Pro, I can grab and drag a geoprocessing tool into a python window and see the tooltip with the required inputs. I am a beginner at using python windows within dynamo, so perhaps I just donât understand how to leverage them correctly. Iâve just noticed that, as a beginner, I have trouble understanding how to translate dynamo node capabilities to a python window.
Perhaps, there is no equivalent/direct translation between them? Or I am just not familiar with documentation regarding this?
For Civils 3d there is also a similar Lookup tool called âSnoop Civil 3dâ which can be found here(https://github.com/ADN-DevTech/Civil3DSnoop). This is installed/extracted to C:\Program Files\Autodesk\ApplicationPlugins
Go back to the Anaconda Command Prompt and create a new environment that uses the correct version of Python - In my case version 3.7.3. Iâve called this environment Dynamo373 and you use the following code to create it:
conda create --name Dynamo373 python=3.7.3
You then want to activate this environment, and do so by typing the following code directly into your Anaconda Command Prompt :
conda activate Dynamo373
You can then use Pip to install to this particular environment with:
pip install numpy
Note you can install other packages here, like Pandas or Keras etc.
Inside this Anacondas Command Prompt you will select the location path where they are being installed to your environment: In my case c:\users\amours\anaconda3\envs\dynamo373\lib\site-packages
Back in Dynamo you will open up a new Python node, set itâs engine to CPython3 and then append this path to your sys.path location.
Then you can simply import all of your desired libraries
Hello,
besides the differences between Python2 and Python3, there are also differences between IronPython and Pythonnet, for example with Pythonnet the conversion of Python objects is not the same as IronPython (Pythonnet does not convert all types of python objects to CLR object (Net))
There is also currently a big difference on the support of COMs objects, with Pythonnet we must use System.Reflection (with a wrapper or not ) to have access to properties and methods
Hello @c.poupin. Thanks for reporting. Your observation is correct, there is a conceptual difference between engines that goes beyond Python syntax. We are currently working on reducing the exposure of those differences to users.
This case in particular worked for me in the latest daily build of Dynamo. Please give it a try and let us know if there is something we missed. Thanks again for reaching out!
Here are a few things I have ran across, but perhaps these are all expected changes as well and I am just not familiar with CP3 to know.
I have found that the reference imports do not go as deep as they did in 2.7. For instance, this worked great in 2.7, but in CP3 I had to use âVisual.Genericâ inline to get to the depth I needed.
One other thing that could be nice for the converter would be âstring.Containsâ to if âcharâ in str: since str.Contains(âcharâ) doesnât appear to work.
Another element for the converter may be list.Add to list.append
It also seems to be pretty slow and spins for a few moments when trying to Load up the autocomplete suggestions for imports etc. Previously you could keep typing, but now it stops, spins, spins, waits, then gives you a list.
Basic Pythonnet package doesnât implement this clr method (and others as IronPython, only GetClrType method as been implemented since 2017 ( Higher compatibility of the clr module with IronPython)
refs and out Parameter does not work (missing in PythonNet, I donât know if you have the possibility to integrate it, or if there is a possibility of workaround)