Hello I am trying to add vectors (XYZ) in my dynamo nodes and it seems all the operations with(+, -, *, etc.) are not working.
the following shows error with subtraction.
I am working on Revit 2025.2 Dynamo 3.2.1
Hello I am trying to add vectors (XYZ) in my dynamo nodes and it seems all the operations with(+, -, *, etc.) are not working.
the following shows error with subtraction.
I am working on Revit 2025.2 Dynamo 3.2.1
Hi @sensiblehira , can you share your script image for understanding? Also, share your Python code to look at.
Hi,
CPython3(Pythonnet2.5) do not support Operators .Net
Solutions :
or
the rest was fine but I couldn’t do vector multiplication
new engine as package? uhhm like ironpython 2.7 now
The IronPython2 package relies on IronPython 2 which is a security issue as it has been unsupported for 5 or six years now.
The CPython3 engine which ships with Dynamo utilizes 3 a supported Python component, as does the IronPython3 package and PythonNet package which are both available on the package manager.
Hi,
Were the guys who wrote CPython the ones who transcribed the operators? There are five with the op prefix.
Thanks.
Sincerely,
Christian.stan
op_
methods (like get_
methods) are generated when compiling the dll (Revit API).
PythonNet2.x alias CPython3 does not support the transcription of op_
methods to python methods __add__
, __sub__
, etc…
Some additional information:
PythonNet2.5, also known as CPython3, was released in 2021 (4 years ago).
IronPython2.7 is no longer maintained (IronPython Team is focus on IronPython3), so it will no longer work in future versions of Net Core (in addition to security risks).
hope we do not have to rebuild same scripts very few years
Every automation you build requires maintenance annually. Doesn’t matter if you build it in Python, C#, or Dynamo. There is a reason add-ins don’t come out the pf
A new Revit release.
Plan for the effort and build a testing framework and it isn’t an issue. Assuming you built the automation once and never have to revisit it is what leads to trouble.
I prefer IronPython 2.7–compatible scripts so they run on older Revit projects; I’ll track Revit API changes, but I don’t want to juggle engine differences (CPython3/Python .NET). I apreciate the new capabilities of the newer engines though, but users do not care, just want things working when clicking a button in any revit version from revit 2019 to revit 2025
CPython3 is compatible with ALL currently supported builds.
IronPython3 is compatible with all but one suppprted build.
No development or automation should be built atop IronPython2 today or at any point in the last year as in about a half year there will be a Revit (and other desktop tools) release which will be incompatible with IronPython 2. Doing o is taking the easy buffet you have for transitioning to another engine (now 5 years long) and converting it into a timebomb which will go off next spring.
Any and all use of an unsupported build (as I type this that means Revit 2022 or prior) outside of black sites (where you can’t get the IronPython2 package installed anyway) is a security risk which can be resolved with a thirty second conversation with whoever has control over the organization / project as they will trigger an update pretty much every time.
some people at this point will be thinking to use only C# without these python issues or even no need of dynamo
Which is fine and encouraged! Automation of any kind benefits the industry - doubly so when we share it with the larger community.
However people who have experience building add-ins which are maintained over time (say 5 years) will point out that it is as much if not more effort to maintain C# based automations than Dynamo based ones.
Take the 2025 release of Revit - many tools which were maintained for a few releases by only changing the target Revit release suddenly us to revise their entire architecture in 2025 due to the .net changes.
Or 2024 with the 64 bit element ID.
Or 2023 with the CEF changes.
Or 2022 with the unit changes.
All of those were handled by the out of the box Dynamo tools at launch.
Even simple stuff like the calculator which is built into Winsows has to be updated (often significantly) with each release.
thanks for the information i take notes, did not know, most people cannot even do the dynamo nodes graph or python, so C# is the hard way or impossible way, so thanks we have Dynamo at least to test things
It’s easier than most think, but there is a LOT of basics which you can’t take shortcuts for. I recommend everyone who has built with Dynamo for a few years install a copy of visual studio code and run though both the developer primer (https://primer2.dynamobim.org/1_developer_primer_intro/3_developing_for_dynamo/1-getting-started) and the Dynamo Unchained workshop from AGES ago (it’s so good that I still use it as the basis for a lot of what I teach people).