FilteredElementCollector is the class you type in every script you will ever write. This is the whole of it in one read: how it gets your elements, the basics, and real examples to copy.
How a collector works, line by line, and how to look inside your elements.
By category, by class, types or instances, views, sheets and annotations.
Real examples to copy, MEP and the special elements included.