I suggest you check whether the family is already loaded before trying to load it (again).
It is so simple.
Here is an example method, from
/// <summary> /// Retrieve cutting symbol, /// loading family if needed. /// </summary> static FamilySymbol RetrieveOrLoadCuttingSymbol( Document doc ) { FilteredElementCollector a = new FilteredElementCollector( doc ) .OfClass( typeof( Family ) ); Family family = a.FirstOrDefault<Element>( e => e.Name.Equals( FamilyName ) ) as Family; if( null == family ) { // It is not present, so check for // the file to load it from: if( !File.Exists( FamilyPath ) ) { ErrorMsg( string.Format( "Please ensure that the void cutter " + "family file '{0}' is present.", FamilyPath ) ); return null; } // Load family from file: using( Transaction tx = new Transaction( doc ) ) { tx.Start( "Load Family" ); doc.LoadFamily( FamilyPath, out family ); tx.Commit(); } } FamilySymbol cuttingSymbol = null; foreach( FamilySymbol s in family.Symbols ) { cuttingSymbol = s; break; } return cuttingSymbol; }
Cheers,
Jeremy