© 2010 Autodesk
Introduction to Revit 2011 API
Element Filtering
3.1 Find a Specific Family Type – System Family Type 
§Find a wall type e.g., “Basic Wall: Generic – 200mm”
§
<VB.NET>
    Function FindFamilyType_Wall_v1(ByVal wallFamilyName As String, _
  ByVal wallTypeName As String) As Element
        ''  narrow down a collector with class.
        Dim wallTypeCollector1 = New FilteredElementCollector(m_rvtDoc)
        wallTypeCollector1.OfClass(GetType(WallType))
        ''  LINQ query
        Dim wallTypeElems1 = _
            From element In wallTypeCollector1 _
            Where element.Name.Equals(wallTypeName) _
            Select element
        ''  get the result.
        Dim wallType1 As Element = Nothing '' result will go here.
        If wallTypeElems1.Count > 0 Then
            wallType1 = wallTypeElems1.First
        End If
        Return wallType1
    End Function
</VB.NET>