Dear Dynamo Experts,
I have been using Dynamo script with IronPython2 node on Revit 2022, without issues for the last 2 years.
This week, I wanted to use the same Dynamo script on Revit 2025.
As Revit 2025 is now using CPython3, I immediately got the following error:
TypeError: No method matches given arguments for OnExist (<class 'Autodesk.Revit.DB'Transaction'>,<class type>, <class TypeError>, <class traceback>) ['File "<string>", line 973, in <module>\n']
The error is raised when on line: t.Commit()
.
Here is an excerpt of the code:
import clr
from System import Array
import System
import time
import math
import sys
clr.AddReference("System.Drawing")
clr.AddReference("System.Windows.Forms")
import System.Windows.Forms
import System.Drawing
import csv
try:
# dynamo dlls
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
import Revit.Elements
clr.AddReference('DSCoreNodes')
import DSCore
from DSCore import *
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
# revit dlls
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI.Selection import *
doc = DocumentManager.Instance.CurrentDBDocument
except Exception as e:
pass
element = UnwrapElement(IN[0])
move_vec = DB.XYZ(0,0,1)
with DB.Transaction(doc) as t:
t.Start('transaction 1')
el_id_L = System.Collections.Generic.List[DB.ElementId]([element.Id])
DB.ElementTransformUtils.MoveElements(doc, el_id_L, move_vec)
t.Commit() # THIS LINE RAISES THE UPPER ERROR
Is this typical CPython3 vs IronPython2 error related with transactions?
I looked at Python2-to-Python3 document, but couldnât find anything about transactions.
Does anyone have any suggestion how to solve this error?
I am quite desperate at the moment.
When I try to use the internal âConvert script to Python3â functionality inside the Python3 node - the Dynamo simply gets blocks, and crashes. The python code is longer then upper excerpt, but still the error happens on such MoveElements
transaction.
I would be grateful for any kind of help.
Thank you in advance.