Dynamo - pyRevit Interferance / Bug (original) (raw)
Hi! I’ve noticed that i cannot run python code-blocks inside of dynamo when i have pyrevit installed. I’ve been trying in Revit 2023,2024, and 2025. I get the error below, and as soon as i uninstall pyRevit, everything runs fine. Have anyone experienced this before, or know how to solve it? See the code i’ve used to reproduce the problem below (it does not have to be that code specific but rahter anything that tries to interact with the api). Moreover, it seems to somehow be related to CPython3, since it works fine in IronPython in Revit 2023. - I’ve also posted on the dynamo forums, where the suggestion was to remove all other addins and do a fresh install of pyrevit then try again. Unforunately, this did not help. Been trying with pyRevit 5.0.1
Error:
SystemError: returned a result with an error set [’ File “”, line 8, in \n’]
import sys
import clr
clr.AddReference('RevitServices')
clr.AddReference('RevitNodes')
clr.AddReference('RevitAPI')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
categories = [BuiltInCategory.OST_DoorTags, BuiltInCategory.OST_WindowTags]
out_list = []
out_elements =[]
for category in categories:
collector = FilteredElementCollector(doc).OfCategory(category).WhereElementIsNotElementType()
out_list.append(collector)
out_elements.append(collector.ToElements())
OUT = out_list, out_elements
Jonn.O (Jonn Øyvind Hosum) April 23, 2025, 10:10am 2
It’s a known issue, with no solution so far unfortunately.
oliwerweber (Oliwer Weber) April 24, 2025, 2:38pm 3
Oh well! Thanks for the response though
oliwerweber (Oliwer Weber) April 29, 2025, 11:56am 4
Update: I’ve found that if i remove all extensions i’ve made through pyrevit, together with their corresponding paths from the pyrevitsettings i can run dynamo-scripts without encountering the same issue! Might not be the best solution but atleast its a decent workaround