【发布时间】:2017-11-07 06:45:17
【问题描述】:
我正在开发一个插件来从中心分离一个文档,当它完成时它也会被清除。我正在努力编写清除代码,我正在考虑从代码中调用 Revit Purge 按钮。如果可能,将感谢支持或分享在 API 中编写清除命令的代码。
谢谢
【问题讨论】:
我正在开发一个插件来从中心分离一个文档,当它完成时它也会被清除。我正在努力编写清除代码,我正在考虑从代码中调用 Revit Purge 按钮。如果可能,将感谢支持或分享在 API 中编写清除命令的代码。
谢谢
【问题讨论】:
The Building Coder 在purge and detecting an empty view 的讨论中提供了一些清除示例的摘要。
【讨论】:
通过一些研究,我想出了解决方案,但它也有一些限制。我们可以从 API 调用 Revit 按钮,包括 Purge。
限制:
以下是实现此目的的示例代码:
UIApplication uiapp = commandData.Application;
//Store the ID of desired plugin button, in this case its 'purge unused'
String s_commandToDisable = "ID_PURGE_UNUSED";
RevitCommandId s_commandId = RevitCommandId.LookupCommandId(s_commandToDisable);
//This revit button will run at the end of your application.
uiapp.PostCommand(s_commandId);
要查找默认 Revit 命令 ID 列表,请单击 here
【讨论】: