Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iFamilyLoadOptions

5 REPLIES 5
Reply
Message 1 of 6
a7v1n
1543 Views, 5 Replies

iFamilyLoadOptions

Hello,

 

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

5 REPLIES 5
Message 2 of 6
ollikat
in reply to: a7v1n

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

 

Message 3 of 6
a7v1n
in reply to: a7v1n

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

Message 4 of 6
a7v1n
in reply to: a7v1n

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

Message 5 of 6
ollikat
in reply to: a7v1n

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.

Message 6 of 6
VinoVinoth92
in reply to: ollikat

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community