Message 1 of 3
Get Instances of Given Types

Not applicable
09-09-2015
07:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
As the title implies, I have a list of family types which satisfies some conditions as shown in below code
Now, from these types, I would ike to get the instances which have been placed in the model
Please assist me on this issue
Thanks
ElementCategoryFilter category = new ElementCategoryFilter(BuiltInCategory.OST_StructuralFraming); IList<Element> typeList = new FilteredElementCollector(doc).WherePasses(category).WhereElementIsElementType().ToElements(); IList<ElementId> noMaterialTypes = new List<ElementId>(); <-- How to get instances of these types? foreach (Element type in typeList) { IList<bool> noMaterial = new List<bool>(); ParameterSet paramSet = type.Parameters; foreach (Parameter param in paramSet) { ParameterType parameterType = param.Definition.ParameterType; if (parameterType == ParameterType.Material && param.AsValueString().Equals("<By Category>")) { noMaterial.Add(true); } } if (noMaterial.Contains(true)) { noMaterialTypes.Add(type.Id); } }