From 53651f6f4a4f7e4f97634955eb13bd50aec514a6 Mon Sep 17 00:00:00 2001 From: Cyril Waechter Date: Sun, 4 Sep 2022 17:28:44 +0200 Subject: [PATCH] Fix set CollectorExt.m_app error Assigning m_app is apparently not required anymore in last RevitLookup versions and not even possible. Error: """python Traceback (most recent call last): File "", line 83, in File "", line 63, in __init__ TypeError: can't set attributes of built-in/extension type 'CollectorExt' """ --- RevitPythonShell/DefaultConfig/init.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/RevitPythonShell/DefaultConfig/init.py b/RevitPythonShell/DefaultConfig/init.py index e679dd8..ee7181f 100644 --- a/RevitPythonShell/DefaultConfig/init.py +++ b/RevitPythonShell/DefaultConfig/init.py @@ -60,7 +60,10 @@ def __init__(self, uiApplication): import RevitLookup self.RevitLookup = RevitLookup # See note in CollectorExt.cs in the RevitLookup source: - self.RevitLookup.Snoop.CollectorExts.CollectorExt.m_app = uiApplication + try: + self.RevitLookup.Snoop.CollectorExts.CollectorExt.m_app = uiApplication + except TypeError: # assigning m_app is now not required and even not possible + pass self.revit = uiApplication def lookup(self, element):