iFamilyLoadOptions

iFamilyLoadOptions

Anonymous
Not applicable
2,174 Views
5 Replies
Message 1 of 6

iFamilyLoadOptions

Anonymous
Not applicable

Hello,

 

Can anyone show me how to implement this function correctly? and also how to include this into LoadFamilySymbol() function? Thanks...

0 Likes
2,175 Views
5 Replies
Replies (5)
Message 2 of 6

ollikat
Collaborator
Collaborator
    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);

 

0 Likes
Message 3 of 6

Anonymous
Not applicable

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...

0 Likes
Message 4 of 6

Anonymous
Not applicable

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....

0 Likes
Message 5 of 6

ollikat
Collaborator
Collaborator

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.

0 Likes
Message 6 of 6

Anonymous
Not applicable

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

0 Likes