Dynamo - Counting Purgeable Elements

I’m working on my Open/Close sheet that’s going to come up with a report of a couple of different metrics I think are important to model health. One of the metrics I can’t seem to count is the number of purgeable elements within the file.

Is there a way to read the Revit API to see how many elements can be purged? I know you can purge elements from dynamo but I currently don’t have any way of counting the elements that can be purged. To be clear, I don’t want to purge elements, I want to count the purgeable elements.

Thanks for the help!

Hi @rjohnston,
You could use the Purge Unused node of the Genius Loci package with the RunIt input set to false to Know the Numbers of elements to purge.

Hey @Alban_de_Chasteigner , thank you for you help! It worked [almost] perfectly. The count produces a string and without editing the code, I just chose to count the id’s. Simple fix but I did need to download the Genius Loci package. Here’s the script for anyone’s future reference

1 Like