[英]How to Call Revit Purge Button from the Revit API
I'm developing a plugin to detached a document from central and when its done it will be purged as well. 我正在开发一个插件,用于从中央分离文档,完成后也会清除它。 I'm struggling writing the code for purge, I'm thinking to call the Revit Purge button from the code .
我正在努力编写清除代码,正在考虑从代码中调用Revit清除按钮 。 If it is possible, would appreciate the support or maybe share the code for writing the purge command in the API.
如果可能,请提供支持,或者共享用于在API中编写清除命令的代码。
Thank you 谢谢
With some research I have come up with the solution but it comes with few limitations too. 通过一些研究,我想出了解决方案,但是它也没有什么限制。 We can call the Revit buttons from the API, including Purge.
我们可以从API调用Revit按钮,包括Purge。
Limitations: 局限性:
Following is the sample code to achieve this: 以下是实现此目的的示例代码:
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);
To find list of default revit command id, click here 要查找默认的revit命令ID列表,请单击此处
建筑编码器提供了有关清除和检测空视图的讨论中一些清除示例的摘要。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.