Dynamo for Civil 3D - get all used and not in use assemblies in dwg file

Hello all,
could you please help me how to get all used assemblies on corridors in DWG file and how to delete all assemblies which are not in use?
Thank you
Lukas