【发布时间】:2015-12-08 13:57:59
【问题描述】:
我在 revit 的测试项目中,
当我创建事务时,由于 ComponentManager.Ribbon 的按钮的“ComponentManager_UIElementActivated”,
我有异常“不允许从在 API 上下文之外运行的外部应用程序启动事务”。
你有解决办法吗?
void ComponentManager_UIElementActivated(
object sender,<br>
adWin.UIElementActivatedEventArgs e)
{
Transaction trans = new Transaction(uidoc.Document); //Work good.<br>
trans.Start("ReTraceWall"); //It don't work, because i have exception "Starting a transaction from an external application running outside of API context is not allowed."<br>
CommandRetraceWall.retracewall(uidoc); //function not called because there is exception before<br>
trans.Commit();<br>
}
*
感谢您的帮助。
你有解决这个问题的样品吗?
Sample using ComponentManager.Ribbon
【问题讨论】:
标签: exception button transactions ribbon