Autodesk / revit-ifc

IFC for Revit and Navisworks (2019+)
476 stars 193 forks source link

Empty IFC files after exporting with Revit api. #411

Open dobrzhanskyi opened 2 years ago

dobrzhanskyi commented 2 years ago

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 with the same size. If assign 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();
        }

    }

`

JOuellette-Autodesk commented 2 years ago

@dobrzhanskyi What version are you seeing it break?

dobrzhanskyi commented 2 years ago

@JOuellette-Autodesk I've tried with many versions and I have the same result. I've tried 22.4.0, 22.4.1, and even beta 22.4.2. Also I've tried to delete Alternative UI exporter to use the built-in -same error,

JOuellette-Autodesk commented 2 years ago

https://jira.autodesk.com/browse/REVIT-190535

sangik-dev commented 2 years ago

I have smae issue. Is it fixed?

DemianRomero1989 commented 8 months ago

Working in January 2024, and having the same issue.

Is it solved?