Hello,
Can anyone show me how to implement this function correctly? and also how to include this into LoadFamilySymbol() function? Thanks...
ref class AutomaticFamilyLoadOptions : public IFamilyLoadOptions { public:
virtual System::Boolean OnFamilyFound(System::Boolean familyInUse,
System::Boolean %overwriteParameterValues) { overwriteParameterValues = true; return true; } virtual System::Boolean OnSharedFamilyFound(Family ^sharedFamily,
System::Boolean familyInUse,
FamilySource %source,
System::Boolean %overwriteParameterValues) { overwriteParameterValues = true; return true; } };
There's one example how to implement IFamilyLoadOptions interface (not a function!!)
And can be used like this
//Load family using Family load options AutomaticFamilyLoadOptions ^iFamilyLoadOption = gcnew AutomaticFamilyLoadOptions; familyDocument->LoadFamily(filePath, iFamilyLoadOption, family);
Thanks. Will this work for LoadFamilySymbol function and not just LoadFamily? cause Im trying to do it using loadfamilysymbol and I cant get it to work right. Revit still loads the family even though I returned false on both OnFamilyFound and OnSharedFamilyFound. Thanks...
Here is my code...
Imports Autodesk.Revit.DB
Imports Annotations.AnnotationsForm
Public Class FamilyOptions
Implements IFamilyLoadOptions
Public Function OnFamilyFound(ByVal familyInUse As Boolean, ByRef overwriteParameterValues As Boolean) As Boolean Implements Autodesk.Revit.DB.IFamilyLoadOptions.OnFamilyFound
Return False
End Function
Public Function OnSharedFamilyFound(ByVal sharedFamily As Autodesk.Revit.DB.Family, ByVal familyInUse As Boolean, ByRef source As Autodesk.Revit.DB.FamilySource, ByRef overwriteParameterValues As Boolean) As Boolean Implements Autodesk.Revit.DB.IFamilyLoadOptions.OnSharedFamilyFound
Return False
End Function
End Class
and....
doc.LoadFamily("C:\ACAD_SUPPORT\Revit\Families\Annotations\Diamond Tag.rfa", New FamilyOptions(), familySymb)
Thank you very much....
Well I have to say that I don't have much experience using this interface. Yes it should work with LoadFamilySymbol() also because it is clearly documented. But if it doesn't work, you could contact autodesk support directly (Dev Help Online).
A quick glance to your code and I couldn't find anything wrong...though I'm not very familiar with VB.
Hi,
I am using IFamilyLoadOptions interface to load my family into another document. I want to load without any overwritten parameters. The interface am using is for load options which is not working. Is there is any possible to accomplish this?.
Thanks and Regards,
Vinoth Kumar.R