Message 1 of 4

Not applicable
10-06-2016
04:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have to retrieve the type id (typically returned by Element.getTypeId()). The only info I have is a family name and there does not have to be an instance loaded into the project.
I manage to find the family (at least that's what I think I'm getting) by the following code
List<Element> families = new List<Element>( new FilteredElementCollector(doc) .OfClass(typeof(Family)) .Where<Element>(e => e.Name.Equals(search_name)));
but when I then try the following code it just returns a type id with value -1
families[0].GetTypeId()
I think this is mainly due to my lack of understanding of revit but no amounts of google searches seems to bring me any closer to a solution to this, it shouldn't be that hard right?
Solved! Go to Solution.