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 ExportToIfc2() method of the current project to export it to the IFC file format. You can specify mapping files and IFC version using IIfcExportSettings.
C++
auto application = Renga::CreateApplication();
auto ifcExportSettings = application->CreateIfcExportSettings();
auto project = application->GetProject();
project->ExportToIfc2(filePath, VARIANT_TRUE, ifcExportSettings);
C#
var application = new Renga.Application();
var ifcExportSettings = application.CreateIfcExportSettings();
var project = application.Project;
project.ExportToIfc2(filePath, true, ifcExportSettings);
You can learn more about IFC export in Renga help.
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