Load Document in Revit API

Load Document in Revit API

Anonymous
Not applicable
1,088 Views
5 Replies
Message 1 of 6

Load Document in Revit API

Anonymous
Not applicable

Hi ,

 

I want to load one document into another document. I am using ("doc1.LoadFamily(doc2);")  loadfamily method to load the document2 in document1. After committing the transaction nothing got loaded. Please suggest your comments to accomplish this.

 

Thanks and Regards,

Vinoth Kumar.R

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

kinjal
Enthusiast
Enthusiast

Hi Vinoth,

 

Did you debug it for exceptions (caution with empty catch blocks)? It is pretty straight forward function. Let us know more about it.

 

By the way, Refer to the Exceptions section in the reference document for this function overload. Maybe you will figureout a possible cause.

 

Best regards,

Kinjal.

Kinjal Desai
Fullstack developer @ Dwaravati
Delivering high quality programmatic boosts for your already beautiful Revit


Message 3 of 6

Anonymous
Not applicable

Hi Kinjal,

 

Thanks for your reply. But am not getting any exceptions while loading that document into target document.

 

Thanks and Regards,

Vinoth Kumar.R

0 Likes
Message 4 of 6

Revitalizer
Advisor
Advisor

Hi,

 

RevitAPI.chm says:

 

"If you are reloading an edited family back into the source document from which it was extracted, this method will always fail. This is because this method automatically suppresses the prompts Revit typically uses to deal with conflicts between families, and assumes that any such conflict should prevent the loading. If you want to be able to reload the same family into the source document, you should use the LoadFamily() overload accepting IFamilyLoadOptions."

 

May this be the cause (and solution) of your problem ?

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 5 of 6

Anonymous
Not applicable

Hi Revitalizer,

 

Thanks for your valid reply. Am using family load options to load document in to source document [doc1.LoadFamily(doc2,new FamilyOption());]. After completion of transaction nothing got loaded in document and there is no families got loaded in target document.

 

Thanks and Regards,

Vinoth Kumar.R

0 Likes
Message 6 of 6

Revitalizer
Advisor
Advisor

Hi,

 

some considerations:

 

May it be that...

 

...you try to load one family into another family, and during this, you mistake source for target document ?

 

...your transaction has an IFailuresPreprocessor attached, suppressing all warnings, handling errors by ignoring them ?

 

...your FamilyOption's behaviour causes the effect ?

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes