Message 1 of 4

Not applicable
04-05-2020
10:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
LightElementList has all the Light Fixture Elements used in the project(400+) and AllItems is a list of Item Class (500+ ) where each item has a property called "FamilySKU".
What I am trying to do is drop elements from LightElementList whose "SKU" parameter value is not found in AllItems. I am able to do that with the following code, but that one single line takes 27sec to finish.
Is there a way to accomplish this in the least amount of time?
Thanks
lightElementsList.RemoveAll(e => AllItems.FirstOrDefault(x => x.FamilySKU == (e as FamilyInstance).Symbol.LookupParameter("SKU").AsString()) == null);
Solved! Go to Solution.