Message 1 of 5

Not applicable
02-22-2017
06:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm having difficulty trying to filter out my walls by a specific name (which works) and by the walls' base constraint to equal the associated level of my active view. This is the code I currently have. The Build is successful but doesn't do anything when I execute the macro. I believe the issue is within the reading the string. Thank you in advance for the help.
Document doc = this.Application.ActiveUIDocument.Document; View myActiveView = doc.ActiveView; Parameter level = myActiveView.LookupParameter("Associated Level"); String levelName = level.AsString(); FilteredElementCollector swwallfilter = new FilteredElementCollector(doc, myActiveView.Id); List<Element>swwalls = swwallfilter.OfCategory(BuiltInCategory.OST_Walls).ToList(); var swtypeelements = from element in swwallfilter where element.Name.Contains("Shear Wall") && element.get_Parameter(BuiltInParameter.WALL_BASE_CONSTRAINT).Equals(levelName) select element;
Solved! Go to Solution.