'Empty IFC export Result
I've created the Revit addin that exports 3d views from the working set. If I am not assign activeViewId to the FilterViewId options, I am getting the whole model in each IFC result file with the same size. If assign activeViewId to the FilterViewId option I am getting empty files. It worked fine, but now I have this strange behaviour. My IFCExportOptions :
IFCExportOptions options = new IFCExportOptions()
{
FileVersion = IFCVersion.IFC2x3CV2,
ExportBaseQuantities = false,
FilterViewId = ElementId.InvalidElementId,
SpaceBoundaryLevel = 1,
WallAndColumnSplitting = false
};
options.AddOption("Name", "IFC Auto");
options.AddOption("SitePlacement", "1");
options.AddOption("Export2DElements", "true" );
options.AddOption("VisibleElementsOfCurrentView", " true");
options.AddOption("Use2DRoomBoundaryForVolume", "false");
options.AddOption("ExportPartsAsBuildingElements", "true");
options.AddOption("TessellationLevelOfDetail", "3");
options.AddOption("UseActiveViewGeometry", "true");
options.AddOption("IncludeSiteElevation", "true");
options.AddOption("ExportSolidModelRep", "true");
Here is a code for export:
using (Transaction trans = new Transaction(doc))
{
foreach (var item in ifcViews)
{
activeViewId = item.Id;
options.FilterViewId = activeViewId;
options.AddOption("ExportIFCCommonPropertySets", "true");
options.AddOption("ActiveViewId", activeViewId.ToString());
trans.Start("ifc export");
try
{
doc.Export(output_path, modelName + "-IFC2x3CV2-" + item.Name, options);
}
catch (Exception ex)
{
trans.RollBack();
}
trans.Commit();
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
