def __init__(self, uiApplication):
'''
for RevitSnoop to function properly, it needs to be instantiated
with a reference to the Revit Application object.
'''
# find the RevitLookup plugin
try:
rlapp = [app for app in uiApplication.LoadedApplications
if app.GetType().Namespace == 'RevitLookup'
and app.GetType().Name == 'App'][0]
except IndexError:
self.RevitLookup = None
return
# tell IronPython about the assembly of the RevitLookup plugin
clr.AddReference(rlapp.GetType().Assembly)
import RevitLookup
self.RevitLookup = RevitLookup
# See note in CollectorExt.cs in the RevitLookup source:
self.RevitLookup.Snoop.CollectorExts.CollectorExt.m_app = uiApplication
self.revit = uiApplication
评论列表
文章目录