
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to get the file path of nested families within a Family document. I can retrieve the host family filepath without problem, but I cannot seem to get the filepath of the nested family(ies). Any suggestions or help would be appreciated. The code snippet below should provide some insight into what I am trying to do. I am having issues with the bolded section.
FilteredElementCollector famCollector = new FilteredElementCollector(doc);
ElementCategoryFilter catFilter = new ElementCategoryFilter(BuiltInCategory.OST_SpecialityEquipment);
ICollection<Element> famCollection = famCollector.OfClass(typeof(FamilySymbol)).WherePasses(catFilter).ToElements();
foreach (Element e in famCollection)
{
FamilySymbol fs = e as FamilySymbol;
string filePath = fs.Document.PathName.ToString(); // does not return the correct file path. returns the path of the host family.
TaskDialog.Show("test", filePath); // used to let me see the filepath in a dialog on screen
doc.LoadFamily(filePath);
}
Any help would be appreciated.
Keith
Solved! Go to Solution.