DynamoIronPython2.7 Package for Dynamo 3 in Revit 2025

After installing the DynamoIronPython2.7 Package (tried the latest and penultimate version), a simple import traceback currently hangs in Revit 2025 with Dynamo 3. The same applies to some other standard IronPython components that are imported.
Do more people suffer from this?

Solutions are simple. You can add a sys.path. And if possible, you can -try- convert the script to CPython. But previous Dynamo versions did not suffer from this. And this seriously hinders the reuse of old scripts by less experienced users, or when in a hurry. :scream:

Is this something to report on Github because it’s a real bug? (p.s. the latest version of the package is not compatible with the linked version of Revit 2025)
Or are there also smart solutions from the user side?

In any case, I want to avoid having to search through all the big and small scripts for IronPython nodes to make manual adjustments. :exploding_head:

MicrosoftTeams-image

1 Like

No need to search - and in fact you can swap the IronPython engine for the new one and most code will work fine, and do so in bulk. This thread and the linked file(s) should help there. Updating python node in multiple scripts - #15 by jacob.small

Once upgraded just run the test and save those which don’t finish correctly in the ‘to update’ directory, and those which run without error in the ‘ready for release’ directory. Once testing is done update the failures in the to upgrade folder, saving them in the ‘ready for release’ directory when done. Once the ‘to upgrade’ folder is sufficiently emptied deploy to production and move onto the next task. :slight_smile:

1 Like

Thanks Jacob
At the moment the inability to load normal IronPython libraries without any Ă©xtra work, (Having to add a new library path or change a scipt to CPython or do smart things in bulk) is a problem for us. From our point of view this is a huge bug. And the mayor reason to prevent our company to use the new Revit 2025 version. We will wait for upgrades. Because we have time to wait, but limited time to make things ‘nicer’ when it did work before. It is harder to sell that kind of time investment to my CEO.

In the meanwhile we wíll dig a bit further into CPython. (We understand the need. But know that it will also give new problems) And we will change whatever we can ‘on the fly’ to make things future proof.
I will also check your thread. Great work there. Appriciated.

Any kind of production program requires an investment in maintenance or a decision to not do so and remove it from production and archive it until you have a need. This has to happen annually at a minimum. You might not have realized it, but Dynamo is programming - visual programming has programming in the name after all. As such before any of us wrote a single line of code or adopted a single package we should have considered the maintenance load. Sadly none of us (or nearly none of us) did so.

Your CEO would certainly not want you using IronPython 2 (what you were using before), and would likely approve ‘making things safe’ by porting to CPython in a hurry if you bring it up. IronPython 2 hasn’t had even security patches for years now (a lifetime in computer speak), and there are a few CVEs which might apply in some way which means there are known vulnerabilities that won’t be addressed until you update.

Fortunately you might have noticed that the Dynamo team will be putting some time into making the Python integration, but perfection is likely a ways out and nothing is certain so your company should take it’s own proactive actions.

Thanks Jacob for the feedback and the link to the road map.
I just ranked the Python Integration on the road map. This is important to us.

Because I’am upgrading Dynamo since roughly 2017, we do have some yearly resources for upgrading. And our workflow in Dynamo, Package use and Python scripts does have some flexibility because of this experience. You are correct that maintainace and testing is truly underrated by everybody. :frowning:

No doubt I miss some deep insight in programming. That is one of the reasons we love Dynamo for help with small and some bigger tedious tasks in Revit.

For now, my main question is why importing (e.g.) traceback in IronPython2 in Dynamo 3 with the DynamoIronPython2.7 package installed, does not work. Unless I add a new library path located on my C drive. And do not use the normal version. It feels less save. And it does not make sense. Also because it did work in all previous versions.
Is importing traceback unsave? It does seem to work in CPython. Or is importing IronPython2 libraries at all unwanted from the site of Autodesk? Is it save to add a library path to my local IronPython2 install, instead of using the one shipped with Dynamo or the DynamoIronPython2.7 package?
It would help me a bit further if I get an answer to these questions.

At the moment it feels like a bug in the DynamoIronPython2.7 package for Dynamo3 as far as i can see.

Well, my best guess is because the IronPython2 package isn’t completely supported for Dynamo 3, and as it’s nearing 4 years out of support it’s unlikely to be fixed (the effort would be better spent on making the CPython or IronPython3 engine more robust).

At this point it’s been almost 4 years since CPython was introduced to Dynamo (both it and Dynamo 2.7 will be 4 on July 15th), and no supported version of any product I know of shipped with the IronPython2 integration - the band aids have persisted despite many in the community encouraging people to ‘migrate what you can to CPython’ often. Most scripts migrate without issue, and often those which don’t usually want to be shifted to a more stable language (C#) for security, reliability, stability, and supportability reasons.

1 Like

Ok. I will see and give it a try. Again. And if I have found time from my actual work.
The loading of a normal library does work in CPython. That’s true.
Still checking a script for some changed API classes and methods is different from changing the whole language. But after checking at least we know more specific which script breaks.

Stil not sure what I want to do when a script breaks. Learning how to make it work in CPython. Removing the script at all. This feels like a loss. Use the quick escape by adding the Python Path to a local IronPython version that does work as it did. This is a strange solution, based on our conversation. Or rewrite it in a different (new) language. We’ll see.

But until all our main scripts and related Packages work, no Revit 2025 I think.

Hi,

For bugs, you can report them here

Then, you should know that Dynamo is working on an update of the CPython engine
with the integration of PythonNet3 (instead of PythonNet2.5) which fixes a lot of bugs

For the Revit 2025 upgrade, if I could make a suggestion, it would be this

  1. start migrating all your scripts to IronPython3 (or CPython3 - it’s simple python code), the fixes would be pretty much as follows:
    • Python3 syntax correction
    • remove unnecessary bits of code linked to the previous version of Revit (example: if revit_api < 2023: do_this())
    • Moving from .Net Framework 4.x to .Net 6+ (e.g. changing Naming Spaces, modifying or replacing COM interrop, etc.)

*at this stage, you can already start working with Revit 2025+ and have got rid of Python2.7
*

  1. Once PythonNet3 has been integrated into Dynamo, if possible, you can gradually switch over to Python nodes to CPython3 engine, with the following fixes:
    • Switch from IronPython3 to PythonNet3 in terms of syntax (out Parameters, Class Interfaces, etc.)
    • Possibly code some libraries in C#, if PythonNet still has bugs in certain functionalities.

This means that you’ll have to dedicate scripts for Revit 2025 and beyond, but this is a changeover, so you might as well start with “new” scripts.
In my opinion, it is one of the least energy-consuming processes

In all cases it is interesting to follow the developments of IronPython and PythonNet

2 Likes

Thanks Cyril for the feedback.
I’m not really running. Maybe hide a little from unnecessary work.
And the narrative remains a bit ambiguous around the security and future-proofing of IronPython2. Perhaps similar to the climate. Things are changing, there are risks, but things are still going well. Something like that.
But we’ll dive in
 when we can. And try to find the best migration workflow / tools for us. And also waiting a bit for others to join.
Creating dedicated dynamo scripts and packages is what we do every year. That is indeed a good way of working

1 Like

the problem is that I’m really not sure that Ipy2 (Ipy2 is no longer maintained) is compatible with future .Net versions (Ipy2 is getting old)

1 Like

Let me remove the ambiguity here:

  • Iron Python 2 Is Not Secure.
  • Iron Python 2 Is Not .NET 8 compatible, so things WILL break.

At this point (4 years after the launch of CPython) anyone writing new code in Iron Python 2 is re-arranging the deck chairs of a sinking ship; sure you’ve come up with a better layout, but perhaps it’s time to make our way to the other boat?

5 Likes

I believe it’s almost time for the package manager to have a way to not show certain packages unless you opt in, particularly those provided as bandaids by the development team. If IP2.7 is not recommended for 2025 maybe it’s time for it not to appear in the package manager for this build too. I appreciate it’s a bigger challenge/consideration to modify how the package manager works, but it would certainly help make it more navigable (and it sure could use a deep clean/nuke at this point anyway
).

make no purchasing decisions, but


Filtering packages by version is actually something the team has discussed, and updating the package manager is something on the roadmap. :smiley:

6 Likes