Dynamo - pyRevit Interferance / Bug

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

It’s a known issue, with no solution so far unfortunately.

Oh well! Thanks for the response though :slight_smile: