Purge/Delete unused elements

@Alban_de_Chasteigner
This is superb but how to make until it becomes 0 (Zero) purged items.

Thanks in advance.

Hi @shrawanram and @Alban_de_Chasteigner ,
I am also having this doubt, have any of you been able to run the script until the purged items are 0?

Thanks,
Clara

Hi Clara,

In Dynamo, you can reproduce the Revit function Purge unused.
But it will be exactly like in Revit, you have to repeat the command 3 times.

1 Like

Hi Alban, I used the python script and got that to execute the revit command ā€œPurge Unusedā€ , but it will only do it once no matter how many times it appears in the Dynamo graph. How can I get it to repeat the command 3 times ?

Hi Philipp,

Itā€™s not possible to repeat the postable command.

See also this post :

Can you share with us the code behind the node Document.Purge? I am curious which method is used to achieve that.
Thank you!

He leveraged a portable command last I knew. Best to ask in the github for the orchid project as he isnā€™t active here anymore.

1 Like

@oliver.green translated this code snippet from VB to IronPython :

The iron python script :

4 Likes

Thank you very much!
Cheers!

Ummm ā€¦ guys ā€¦ I canā€™t find anyone whoā€™s posted this here yet but:
Model Cleanup - Deleting Views
About Aug 2017, @Andy_Grout posted regarding a model cleanup complete with choices running in the Dynamo Player.
Iā€™ve also created & use this Purge All graph: Purge%20All%20graph
This graph uses the Orchid package 202.4.2 or newer. Developed in Dynamo 2.0.

[edit] Missed listing @erfajo 's post, it is another example of purging. His post is for purging excess files from a directory though (ie: RevitFile.0001.rfa). Iā€™m still learning.

Hope this helps.

There is a Youtube Video to purge unused

Dynamo - Purge Unused

Hey guys I found this on twitter by someone named Bird Tools. I donā€™t know much about this command, but I tried it in Dynamo and it works but it takes a while to process.

2 Likes

You can also use Document.PurgeUnused in nodal form which is in Revit 2021 and upwards :slight_smile: The DesignScript call you reference is calling the same node!

6 Likes

How do you purge a specific category via a script?

@Gcf_Design please start a new post as that is a new question and this post is solved, thanks

what if i need the count only