Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 67020

retrieving type id based on family name

$
0
0

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?


Viewing all articles
Browse latest Browse all 67020

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>