我正在尝试在我的铁python加载项上使用revit事件(使用pyRevit添加带状和按钮),但我真的不明白该怎么做。
我找到了这段代码,但我无法让它工作。首先,每次激活视图时,我都要打印“视图激活”
https://github.com/eirannejad/pyRevit/issues/201
from System import EventHandler, Uri
from Autodesk.Revit.UI.Events import ViewActivatedEventArgs, ViewActivatingEventArgs
def event_handler_function(sender, args):
# do the even stuff here
# I'm using ViewActivating event here as example.
# The handler function will be executed every time a Revit view is activated:
__revit__.ViewActivating += EventHandler[ViewActivatingEventArgs](event_handler_function)谢谢,
https://stackoverflow.com/questions/60568559
复制相似问题