I made a script with Python to create a point in DYNAMO. It worked fine with CPython on Revit 2022, but I get an error message when I use Revit 2023.1 or Revit 2024.1.
Everything’s is fine if I run it with IronPython in revit 2023.1, but it doesn’t work on CPython anymore.
Do you have any idea about the cause of the problem ?
I have not been able to reproduce this so to figure out more about what could be causing this I would like to get more info.
Please confirm the Dynamo version used by Revit 2024; should be 2.19.3.xxx
Assuming the Dynamo version used by Revit2024 is 2.19.3.6394 please download dynamo locally from here https://dyn-builds-data.s3-us-west-2.amazonaws.com/DynamoCoreRuntime_2.19.3.6394_20231002T0726.zip
Now let’s try to reproduce the issue with dynamo sandbox. This should tell us if the issue is caused by Dynamo running in the Revit context. Also try to run the Point API call and then a something simpler like
import sys
OUT = sys.path
Now to get more info on what is happening on the Revit side:
Try to run this in Dynmo Revit 2024 and share it. import sys OUT = sys.path
List any custom pacakges loaded by python:
Dynamo 2.19.3 should be using python-3.9.12-embed-amd64
go to `%localappdata%/python-3.9.12-embed-amd64 and list out the packages under Lib\site-packages (site-packages might be missing if you did not install anything manually)
As a side note: Dynamo uses an Embeddable Package of Python. This allows Dynamo to have its own Python home, without requiring users to install Python or adding it to the PATH. More info here
List the dynamo packages and their versions(Open up Preferences-> Pacakge Manager -> Installed pacakges and take a snapshot of the installed packages list)
Hello all,
any progress on this topic please? I am using many scripts with Cpython3 and none of them works right now on Revit 2024.2. It is not possible for me to downgrade all scripts to IronPython2…
Hi @Lucy_Lastparametrics - In the interim you can try the IronPython3 package. We have not yet started upgrading PythonNET, but it’s on our to-do list.
Yes, the Dynamo version is 2.19.3.6394.
I still have the issue with Point.ByCoordinates() when using DYNAMO with Revit. But it works with DynamoSandbox.
PythonNET isn’t the new .NET upgrade for Dynamo, but rather an entirely different project that “bridges” the worlds of .NET (Dynamo) and Python together and allows them to talk to each other. You can read more about it here.
This project is open source so we are reliant on them putting in fixes to that, or doing fixes ourselves. So far in Dynamo we opted for the latter, which is fixing things ourselves, but the problem with that approach is that we get more and more out of sync with the PythonNET project main branch and at some point that overhead becomes too high. So, we want to upgrade to their main branch as, given time has passed now, they have caught up with some of the fixes we put into Dynamo. Other fixes salient only to Dynamo users will persist on our side.
Note that ‘none’ indicates another issue beyond the CPython. There are a LOT of breaking changes in the Revit API between the last supported version of Iron Python 2 and 2024.2, so best to verify those are resolved as most Python should work fine, or can be made to work with minimal modifications (excepting the iInterface issues).