- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Im stuck with something appearently simple but I dont know how to handle it. What Im trying is,
having a list of views, obtain the elements in these views, eg:
foreach (View V in Views)
List<Element> ListElements = new FilteredElementCollector(doc, V.Id);
It raise error CS1023, embedded statement cannot be a declaration or labeled statement.
What I understand here is that I cannot declare List or Enum inside a foreach loop right? But in this case, how can I extract this elements?
I have also tried declaring the List/Enum before...
List<Element> ListElements = new List<Element>();
foreach (View V in Views)
ListElements.Add(FilteredElementCollector(doc, V.Id));
but then it raise error CS0118, is type but is used like a variable. Any ideas? Thanks!
Solved! Go to Solution.