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: 

Open Nested Families as document to export them like a document

1 REPLY 1
Reply
Message 1 of 2
Anonymous
415 Views, 1 Reply

Open Nested Families as document to export them like a document

Hello everybody,

we are working on an export tool for exporting data from a Revit project to a database system, by using Revit API.

Most of the export functions work fine.

The only problem we have at the moment is, that opening a Nested Family as Document in order to export the model data from this Family, is not working.

I've already tried many suggestions from Autodesk Forum posts, which included some of our problems we currently have. But unfortunately no solution was successfully so far.

The Families I'm talking about are nested *.rfa files, storted in the Revit Document file (*.rvt).

I also checked if they are really Family Documents to prevent exceptions of this kind, but it din't help.

I used the method "LoadFamily" and "EditFamily". But most of the exceptions said, that either the document file was read-only or threw other exceptions. I also tried to solve these problems by using Transactions, which is very common for these kind of use cases. Opening the source Document by using an own Transaction didn't work, too.

It would be pretty nice if somebody could help me with this issue.

 

With best regards

R. Schoenig

1 REPLY 1
Message 2 of 2
jeremytammik
in reply to: Anonymous

I'm surprised you have to struggle so.

 

I am also surprised that read-only documents pose a problem for you.

 

Why can't you process read-only documents, if all you are doing is exporting data without modifying anything?

 

EditFamily sounds like a fine approach.

  

You can also open the family documents using OpenDocumentFile:

 

https://www.revitapidocs.com/2020/11420983-6d0d-0022-e24c-2361c4e42fba.htm

  

I don't think you need any transactions for either of those.

 

Anyway, here is a bunch of articles by The Building Coder on handling nested family definitions:

 

 

I hope they help.

 

Best regards,

 

Jeremy

   



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

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

Post to forums  

Autodesk Design & Make Report