Message 1 of 2
Exporting with PhaseFilter "New Only" exports nothing
Not applicable
05-27-2018
09:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Exporting using a PhaseFilter with only ElementOnPhaseStatus.New set to visible results in no models or materials being exported. If ElementOnPhaseStatus.Existing is set to visible, everything is exported correctly but there are duplicate elements.
A View3D with the filter applied, is created for each phase, and the project is run through an IModelExportContext using the created views. I'm currently testing on the Sample House scene in Revit 2019.
Attached is a screenshot of the resulting export when ElementOnPhaseStatus.Existing is set to visible.
// create phase filter
PhaseFilter phaseFilter = PhaseFilter.Create(doc, "Export New Only"); phaseFilter.SetPhaseStatusPresentation(ElementOnPhaseStatus.Existing, PhaseStatusPresentation.DontShow); phaseFilter.SetPhaseStatusPresentation(ElementOnPhaseStatus.Demolished, PhaseStatusPresentation.DontShow); phaseFilter.SetPhaseStatusPresentation(ElementOnPhaseStatus.New, PhaseStatusPresentation.ShowByCategory); phaseFilter.SetPhaseStatusPresentation(ElementOnPhaseStatus.Temporary, PhaseStatusPresentation.DontShow);
// each view has phase filter applied view.get_Parameter(BuiltInParameter.VIEW_PHASE_FILTER).Set(phaseFilter.Id);
// export using the created views
CustomExporter exporter = new CustomExporter(doc, new ModelExporter(doc))
{
#if REVIT_2015
IncludeFaces = true,
#else
IncludeGeometricObjects = true,
#endif // REVIT_2015
ShouldStopOnError = true
};
exporter.Export(viewIds);
exporter.Dispose();