Automatically import IFC-file via Revit API

Automatically import IFC-file via Revit API

Anonymous
Not applicable
1,166 Views
0 Replies
Message 1 of 1

Automatically import IFC-file via Revit API

Anonymous
Not applicable

Hi!

 

At the moment I am trying to write a C#-addin with the use case mentioned in the title: Automatically import a given IFC-file (correctly: its elements) to the ActiveView of the currently opened document using the Revit API. Unfortunately the Autodesk.Revit.DB.Document provides no overload for the Import-method using IFC. Also the Autodesk.Revit.UI.UIApplication or Autodesk.Revit.ApplicationServices.Application did not provide a helpful method for me.

 

Inspired by @jeremytammik  approach (thebuildingcoder.typepad.com/blog/2010/07/ifc-import-and-conversion-journal-script.html) I did the following:

  1. Import given IFC-file using Application.OpenIFCDocument
  2. Use a FilteredElementCollector to find my relevant views and elements
  3. Export the IFC-Document to DWG using Document.Export
  4. Re-import one of the created DWG-files to the ActiveView of my current Document using Document.Import

Nevertheless, I have some problems with this approach. So here are my questions:

  1. Which DWG-file should I re-import? The Document.Export creates several DWG-files with different views. Usually the one with the layout/groundplan suits my needs. Maybe there is an export-option I am missing that could help me out here.
  2. How do I get the correct filename of my desired DWG-file? Using the Document.Export the files created can be named differently (depending on the input IFC-file, I guess).
  3. Is there really no easier way to do this 🤔. This approach somehow feels dirty ...

Thanks for your help!

0 Likes
1,167 Views
0 Replies
Replies (0)