I just merged the first draft of IronPython 3.4 engine into pyRevit source and WIP installers. IT IS WORK IS PROGRESS SO DO NOT TEST IN PRODUCTION
The new engine is available under settings and is named
IronPython 3 (340)
Alternatively you can use the pyRevit command line to attach pyRevit to installed Revits using the new engine. Assuming your clone is named
main the command would be:
$> pyrevit attach main 340 --installed
I have modified pyRevit’s source code to be compatible with both IronPython 2 and 3. There is a
compat.py module in
pyrevit library that provides the necessary globals so you can configure your codes as well
from pyrevit.compat import PY3, PY2, IRONPY340
# do this
# do that
Libraries shipped under
site-packages in pyRevit installation, are supposed to be compatible with both py2 and py3. Please test and report any errors.
You can download the WIP installers from here
Is this only me or link is broken ?
@Konstantin you’re right
on the repo, go to Actions, then pick the latest build from develop branch and download installers
- using the CLI clone the develop branch
pyrevit clone <clone_name> [--dest=<dest_path>] [--source=<repo_url>] [--branch=<branch_name>]
- attach it to your revit versions
pyrevit attach nameOfYourClone 340 --installed
Poof sorry. I apparently fogot to put the link there. Updated to the lasted WIP build link right now.
Thanks @Jean-Marc for the answer and screenshots
Hi @eirannejad, I feel a certain excitement, but I am not sure what the additional features or benefits are yet compared to CPython or IronPython 2.X ?
I tried looking at the IronPython 3.4 release notes, but this also didn’t enlighten me. Does this allow us to run pyRevit scripts using both Python 3.4 libraries and pyRevit modules?
Try these notes:
tick marks means already implemented. e.g. for IronPython 3.4 there is already f-string feature, even it is only available since python 3.6
I am personally very excited about ipy3, and looking forward to switch to it. Testing it now. Feels like I sit in a new car
from the other hand, there is no tick next to
enum module, but the module is in the library, we can import it now.
then I have no idea what these tick-marks mean
mystery. gotta try one by one:
@GooseG IronPython has its own merits, namely:
- Compilable to dotnet DLLs
- True multi-threading (CPython has a global interpretter lock (GIL) that forcefully syncs threads so the multi-threading performance in IronPython is better)
CPython and IronPython, althought both python 3, implement it completely differently and they’re just different beasts.
Your existing pyRevit scripts should run nicely in the new IronPython 3 with the added benefit that you can completely forget about python 2 (python 3 has much more powerful language constructs and libraries)
Use CPython when you’d need to use any of “native” libraries built for CPython e.g. numpy, scipy etc
I have some wpf so I cannot use cpython
but I also want to use numpy
is it possible???
You have to use WPF purely programmatically. CPython doesn’t have WPF bindings yet
how about winform + numpy instead of wpf?
seems I can use winform on cpython
That’s an option as well. There is also the cross-platform Eto library that could be used programmatically.
I’ve started getting errors.
How do I report them? Just make an issue in repository? Any special name?
yep, issue in the repo, following the template.
you can prefix it IPY340 maybe?