From the course: Revit: Creating C# Plugins

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Querying FilteredElementCollector

Querying FilteredElementCollector

From the course: Revit: Creating C# Plugins

Start my 1-month free trial

Querying FilteredElementCollector

- [Instructor] Before we continue learning how to create elements, I'd like to take another look at the filtered element collector to learn how to make them more concise through LINQ extensions and lambda expressions. If you have not used LINQ, or Language-Integrated Query before, it is simply a feature of C sharp that allows us to query different data sources and filter the results. This is done using the from, where, and select query operators. For example, from x in data source where x equals some function, select x. So it allows us to filter through data sources using different functions. While we won't be creating LINQ queries in this video, we will be using LINQ extension methods. Extension methods are methods added to an existing object type. LINQ extension methods allows us to add query functionality to existing C sharp IEnumerable types such as a list or the filtered element collector. Extensions include many different methods, such as first to get the first item in a list…

Contents