Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
It seems an old problem, but I find in forum for long time and didn't find solution.
Question 1:
My Idea is get a List<Category> of physical element. Here is my code
ICollection<Element> allElelements = new FilteredElementCollector(doc, doc.ActiveView.Id).WhereElementIsNotElementType() .Where(x => (x.Category != null) && x.GetTypeId() != null) .Where(x => x.IsPhysicalElement()) .ToList(); List<Category> catList = allElelements .Select(x => x.Category) .Distinct() .ToList();
But maybe Distinct is not working here so that the list has duplicate categories.
How can I fix my code?
Question 2:
I want to get all category list of VG overrides in tab "Model Categories"
I use Category.CategoryType = CategoryType.Model but it contains some Categories that i don't want to.
Thank you in advanced. Your solution is appriciated.
Solved! Go to Solution.