If you wish to access any information from a Revit Family, be its specific parameter value, category, etc., without opening the family file, you can always load the family and access the information required. However, if have to do this for a number of family files, loading all the families will increase the model file size – that too just for reading a small piece of information. A better approach is to use transactions, load up the family file(s), access the specific family information required (say Family Category) and then roll back the transaction. With rolling back the transaction, it is almost like we never loaded the family to read the information from the Family file. The code below illustrates the complete approach.
public class Command : IExternalCommand
public Result Execute(ExternalCommandData commandData,
ref string message,
Document doc =
Transaction trans = new Transaction(doc, "Open Family");
Family fam = null;
doc.LoadFamily(@"C:\Users\xyz\Desktop\Sample.rfa", out fam);