- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm writing a routine which iterates all families in the document to find which ones have CAD imports, the idea is based on this post:
https://thebuildingcoder.typepad.com/blog/2009/05/imports-in-families.html
The routine I've written get all families:
FilteredElementCollector checkDWG = new FilteredElementCollector(fdoc).OfClass(typeof(ImportInstance));
And then iterates when trying to open them to check for an imported instance, the families are open with:
doc.EditFamily(f)
f being the families from the collector above.
This works fine, except the list of families includes some that cannot be opened - such as a Curtain Wall Mullion etc.
At the moment I use a Try - Catch statement to stop the inevitable 'unable to open family' error when the routine tries to open these families, but this is a very inelegant solution.
Is there something that I can test for in the families - some sort of IsLoadableFamily flag etc? so the routine can skip these families?
Thanks.
Solved! Go to Solution.