title: How do I get all elements of a certain category, type and familiy in revit
body: <p>I have a function where I would like to get all elements belonging to a certain category, type and family. I have their names as strings and would like to obtain the actual elements that meet the criteria. </p>
  
  <p>I have tried a bit with the following: </p>
  
  <pre><code>    internal static void getElemetWithId(Document doc,string catName, string famname, string symbname)
      {
  
          Category category=null;
          foreach (var cat in  doc.Settings.Categories){
              if (((Category)cat).Name.Contains(catName))
              {
                  category = (Category)cat;
                  break;
              }
          }
          HashSet&lt;Element&gt; elements = new HashSet&lt;Element&gt;();
          elements.AddRange(GetFilteredElementCollector(doc, new ElementRetrievalOptions())
            .OfCategory(category).WhereElementIsElementType(famname).ToElements());
              }
  </code></pre>
  
  <p>However this doesn't work as OfCategory does not accept a Category as a argument (it does work for a builtInCategory) and WhereElementIsElementType does not seem to accept any argument. </p>
  
  <p>A possible input for this function would be <code>document, "Doors" , "M_Single-Flush" , "0915 x 2134mm"</code></p>