v2.2
How to export to IFC, DWG/DXF

Overview

Renga API supports exporting data to common file formats used in other computer-aided design systems: IFC, DXF, and DWG.

Export to the DXF and DWG file formats is currently available for drawings only.

How to export a project to IFC

Use the ExportToIfc() method of the current project to export it to the IFC file format.

C++

auto application = Renga::CreateApplication();
auto project = application->GetProject();
project->ExportToIfc(filePath, VARIANT_TRUE);

C#

var application = new Renga.Application();
var project = application.Project;
project.ExportToIfc(filePath, true);

How to export a drawing to DXF or DWG

To export a drawing either to the DXF or DWG file format use the ExportToDxf() and ExportToDwg() methods respectively.

The following example shows how to export all the drawings in the project to separate DXF files.

C++

auto application = Renga::CreateApplication();
auto project = application->GetProject();
auto drawings = project->GetDrawings();
for (int i = 0; i < drawings->GetCount(); ++i)
{
auto drawing = drawings->Get(i);
drawing->ExportToDxf(GetFilePathForDrawing(i), Renga::AutocadVersion_v2000, VARIANT_TRUE);
}

C#

var application = new Renga.Application();
var project = application.Project;
var drawings = project.Drawings;
for (int i = 0; i < drawings.Count; ++i)
{
var drawing = drawings.Get(i);
drawing.ExportToDxf(GetFilePathForDrawing(i), Renga.AutocadVersion.AutocadVersion_v2000, true);
}

See also

Related samples

  • ExportIfcDwgDxf