我正在开发一个插件来从中央分离文档,当它完成时它也将被清除。我正在努力编写清除代码,我想从代码中调用Revit Purge按钮。如果可能的话,将非常感谢支持或者可以共享用于在API中编写purge命令的代码。
谢谢
答案 0 :(得分:1)
通过一些研究,我提出了解决方案,但它也没有什么限制。我们可以从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
答案 1 :(得分:1)
Building Coder在purge and detecting an empty view的讨论中提供了一些清除示例的摘要。