Delete unused materials

Hey community!
This is my first post - and i have done actually no dynamo programming,
but i am looking for some way to get rid off my unused materials!

Does anybody have a clue?


Hello and welcome! It is recommended to explore the forum a little bit before posting. You can type your keywords in the search field and find some clues to get started. If needed, there are at least two sites that could help you to find some basic answers along your way:
You also need to be aware that it’s necessary to show what you’ve done or what you found so far on the topic in order to get some help. The rest of the advice can be found in this thread:

Well you could start by a comparison between a Revit material schedule and all the materials extract with Dynamo.
Then just delete the difference.


@Yna_Db Thanx for that! i did a search already…
i did not find any solutions discussions for deleting unused materials…
so i thought i start one…

@Yien Thx for your reply!
as i mentioned i am a absolute beginner!
we just start to get into dynamo
i tried to use a already made dynamo for deleting unused LINE-TYPES…
but the package seems to be outdated (?) - because the needed part “Delete Elements” i cannot find…

we actually work hard on projects… so there is little less time for "learning"
but i want to get into it…

our problem is, that using revit, after a while there thousands of unused materials called “Standard” and we didn’t found the origin where there came from… so rigth no we just try to find a way (outside the revit function to purge)
to delete in selective way…

the overall aim is to get a dynamo to choose what to delete, and the delete chosen elements…

sorry for my question, but how would you start?

here the node i just made.

the top is to select ALL material in project.
the bottom, is to select material that is use in the project : you must create a material schedule within Revit, because the node extract the data from the view schedule.

you will need those packages with Dynamo 1.2 :


so the compare node just made a difference a give Material NOT in use.
the last step is deleting material by id.

hope it help

mat not in project.dyn (10.1 KB)

Hey Yien

thanx for your effort.
i didn’t found time to test your node, but i will…

meanwhile i found another way to delete Materials with a string input,
so i find those “nasty” materials called “Standard” (i don’t know where there are coming from…)

But, unfortunately there are some “more” unused Materails - named “Standard”, which are called - in german Materialobjekt > Darstellung
see here
(in my next post - i can only post one pic - not file!)
there are some thousands more “Standard” - i think they are called Assets???

I did not find a way to “pick” those as well…

Maybe you know how to pick/name&grab them?

in one project we had aprox. 189.000! to purge, which took around 20 min. and gave back aprox. 20-30MB file size…!



So here those Material Assets??? in german

maybe someone knows how to pick them?

oh i forgot,
you need the JBE package (Eraser)
i use Dynamo 1.2

This maybe? (found through the search field):

1 Like


I believe Assets are parts of materials.
Once unused material is deleted, you must also purge the remaining assets.


@Yna_Db thnx a lot!
I’ll try next day…
will show results later!


Unused Materials come up with the standard Purge. What did I miss? Are you trying to make it part of a larger graph?

1 Like

Thanx, you didn’t miss anything,
i just try to get rid of some controlled Materials (etc.) which seem to “grow” in my project file (lately 240.000!)
named "Standard"
and yes i could use the purge comand, but - in my case, it takes aprox 8-10h just find all unused !!!.. :-o
so i try to focus on those nasty ones…

the aim is as well to be able to purge controlled elements, and choosing them before using the purge comand.

yes i know, but that is, when the “pain comes”…
my file is aprox. 170 MB, so it takes about 2-3h just from clicking purge unuse > till menu comes up…and the another big slice of time - just to uncheck all, and then try to check just the ones i whant to get rid of… omg!

what i dream of is as follows:

i want a way to save the things/elements/mats…etc. i want to purge before i actually purge them…
becaus, sometimes i just want to get rid of - say - for ex. some dimensions i wouldn’t use…

next time i want to purge some other stuff…

maybe i get the idea.

the standard purge unused command is not cusomizable,
and thats want i try to do…

8-10 hours?!?!? That’s insane. How big is your file?

Something sounds very wrong here. 170mb isn’t that big. Mine are typically twice that and it takes no more than 20 seconds to bring up the purge dialog. Selecting 50-100 materials isn’t instantaneous but certainly no longer than opening the dialog in the first place.

I don’t know what to tel you. Good luck!

I’ve seen that happen when there are a ton of object styles that were brought in. This could be a result of CAD imports and the like.

@Ladislaus Check the size of your CAD files which you have in your model. It might also due to your CAD files have DGN Line Patterns those have got 1000’s of Line patterns that will come along when you Import/Link CAD file.

Is it possible for you to drop dummy rvt file?

If this is a workshared file, you should be the onely one working with this file when purging. If not and another user saves to central, all your material will return.



Hey guys, thank you a lot…!

actually i am hard at work…
so i will reply to all of you later!

no it is not a workshaerd file… :-/