Skip to content

feat(cli): read IFC and RVT input through IfcIO.Scene and RvtIO.Scene - #28

Draft
mahach666 wants to merge 7 commits into
mainfrom
feat/cli-adapters
Draft

mahach666 wants to merge 7 commits into
mainfrom
feat/cli-adapters

Conversation

@mahach666

@mahach666 mahach666 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What changes and why

The ioviewer tool reads IFC (.ifc, .ifczip) and Revit (.rvt) models through the engine adapters IfcIO.Scene 0.11.0 and RvtIO.Scene 0.4.0, so a model becomes a viewer without writing code. The IOViewer library is unchanged (nothing under src/IOViewer) and still depends only on IOScene; only the IOViewer.Cli tool package references the engines.

CLI

  • .ifc/.ifczip are read with IfcSceneReader.Read, .rvt with RvtSceneReader.Read; the resulting SceneDocument is wrapped in a ViewerDocument. The usage line, --help and the unsupported-extension message list the new inputs.
  • The model key is the file name; the title is the IFC project name, or the file name when the scene has none (Revit).
  • Adapter diagnostics go to standard error, one line per severity and code with a count of the rest (Error: read-cut: ... (1 more)). Info entries are not printed. Error severity is printed as Error:, but the exit code stays 0.
  • WarningsNotAsErrors NU1901-NU1904 in IOViewer.Cli.csproj: with TreatWarningsAsErrors and NuGet audit on, an advisory against a dependency of an engine would otherwise fail the tool build and the release.

Repository

  • Directory.Packages.props: IfcIO.Scene 0.11.0 and RvtIO.Scene 0.4.0.
  • THIRD-PARTY-NOTICES.md: a section for the tool package listing IfcIO, RvtIO, the .NET DeflateManaged sources compiled into RvtIO, OpenMcdf 3.4.0 (MPL-2.0) and SharpZipLib 1.4.2, plus buildingSMART and Autodesk trademark lines.
  • README, docs/getting-started.md, docs/index.md and the CHANGELOG [Unreleased] section describe IFC and RVT input.
  • CONTRIBUTING release checklist: before the tag, run the Revit test against a real Revit 2022 file (IOVIEWER_RVT_FILE, --filter Cli_ConvertRvtToHtml), which CI does not have.

Tests

Added to ModelAndCliIntegrationTests:

  • Cli_ConvertIfcToHtml_ReadsTheModelThroughIfcIO: an IFC2X3 model built in code (wall with Pset_WallCommon, unstyled window, proxy with hostile name and property strings) converted to HTML and JSON. Checks exit code 0, empty standard error, model key, title, 3 instances, the wall's properties and GlobalId as sourceId, the window's half opacity, and that the hostile string is not written raw into the page.
  • Cli_AdapterDiagnostics_AreReportedOncePerSeverityAndKind: grouping, counts and the Error:/Warning: prefixes.
  • Cli_ConvertRvtToHtml_ReadsTheModelThroughRvtIO: runs only when IOVIEWER_RVT_FILE names a Revit 2022 file, skipped otherwise; no Revit file is committed.
  • CliTests: the help assertion follows the new usage line.

Run with IfcIO.Scene 0.11.0 and RvtIO.Scene 0.4.0 packed from their branches into a local package folder (RvtIO.Scene from feat/rvtio-scene at ae61489, with the fixes of IOExtend/RvtIO#197 and IOExtend/RvtIO#198):

  • dotnet build IOViewer.slnx -c Release has no warnings: 0 warnings, 0 errors.
  • dotnet test IOViewer.slnx -c Release passes: 118 tests on each of net8.0 and net10.0, 117 passed, 1 skipped (the RVT test without IOVIEWER_RVT_FILE). With IOVIEWER_RVT_FILE set to a private Revit 2022 sample the RVT test passes on both TFMs: 731 meshes, about 9.8 MB of HTML, one no-geometry warning line on standard error.
  • The pages from that sample and from the IFC test model repeat no member name in any object of the properties and meta blocks (checked with a JSON parser that reports duplicates); the Revit page has 37 property names with a numbered suffix (feat!: build the viewer on the IOScene scene model #27).
  • Generated HTML and JSON for the same inputs are unchanged (no library or viewer code changed)
  • No customer models, personal data or vendor code is added; the engines and their dependencies are listed in THIRD-PARTY-NOTICES.md

CI cannot restore this branch yet: IfcIO.Scene 0.11.0 and RvtIO.Scene 0.4.0 are not on nuget.org.

Notes

  • Draft. feat!: build the viewer on the IOScene scene model #27 (IOScene scene model, 0.3.0) is merged and this PR targets main; its diff is the CLI change only. It stays a draft until IOScene 0.1.0 is published and IfcIO.Scene 0.11.0 and RvtIO.Scene 0.4.0 are released on top of it, because the engines' release scripts refuse an adapter on a preview IOScene.
  • Depends on the IfcIO.Scene 0.11.0 and RvtIO.Scene 0.4.0 releases on nuget.org. Until both exist, restore and CI fail; the PR stays a draft until they are published and CI passes.
  • Open question: an adapter diagnostic of Error severity is printed as an error but does not change the exit code. Should it make ioviewer exit non-zero?

The CLI printed every adapter diagnostic other than Info with the prefix
"Warning:". Diagnostics are now grouped by severity and code, and a group
of Error severity is printed with "Error:".
The OpenMcdf 3.4.0 package names github.com/openmcdf/openmcdf as its
repository; the notices pointed to the former location.
@mahach666
mahach666 changed the base branch from feat/ioscene to main November 12, 2026 21:33

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant