You will find that neither of the following overloaded methods will work for you:
public bool Document::LoadFamilySymbol(string filename, string name)
public bool Document::LoadFamilySymbol(string filename, string name, out FamilySymbol symbol)
You will have to use the third version of this overloaded method:
public bool Document::LoadFamilySymbol(string filename, string name, IFamilyLoadOptions familyLoadOptions, out FamilySymbol symbol)
In order to use this though, you will have to implement the IFamilyLoadOptions interface like this:
class FamilyOption : IFamilyLoadOptions
{
public bool OnFamilyFound(
bool familyInUse,
out bool overwriteParameterValues)
{
overwriteParameterValues = true;
return true;
}
public bool OnSharedFamilyFound(
Family sharedFamily,
bool familyInUse,
out FamilySource source,
out bool overwriteParameterValues)
{
source = FamilySource.Family;
overwriteParameterValues = true;
return true;
}
}
Next use the instance of this class with the right version of the LoadFamilySymbol method like this:
document.LoadFamilySymbol(familyFile, symbolName, new FamilyOption(), out gotSymbol)