Reputation: 1315
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. If it is possible, would appreciate the support or maybe share the code for writing the purge command in the API.
Thank you
Upvotes: 0
Views: 1265
Reputation: 8294
The Building Coder provides a summary of some purge examples in the discussion of purge and detecting an empty view.
Upvotes: 1
Reputation: 1315
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.
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
Upvotes: 1