Skip to content

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

Merged
mahach666 merged 11 commits into
mainfrom
feat/cli-adapters
Nov 13, 2026
Merged

mahach666 merged 11 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.1 and RvtIO.Scene 0.4.0, so a model becomes a viewer without writing code. The IOViewer library still depends only on IOScene; only the IOViewer.Cli tool package references the engines. The last commit prepares the stable release 0.3.0 on the released packages.

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.
  • An adapter diagnostic of Error severity (today only from RvtIO.Scene: geometry-undecoded, read-cut, failed-members, which mean that elements may be missing) makes the tool exit with code 4 after it has written the page and the JSON; warnings keep exit code 0. Codes 1 to 3 are unchanged. (The open question of the draft, decided by the maintainer.)
  • WarningsNotAsErrors NU1901-NU1903 in IOViewer.Cli.csproj: with TreatWarningsAsErrors and NuGet audit on, a low, moderate or high advisory against a dependency of an engine would otherwise fail the tool build and the release. A critical advisory (NU1904) still fails it, since the engines parse untrusted files.
  • Text that diagnostics and load or export errors quote from the model (such as element names) is printed with control and format characters (escape sequences, line breaks, bidirectional overrides, tag characters) replaced by ?.

Release 0.3.0

  • Version 0.3.0 (was 0.3.0-preview.1); CHANGELOG ## [0.3.0] - 2026-11-13 with the entries that were under [Unreleased], and an empty [Unreleased].
  • IOScene [0.1.0, 0.2.0-0.0), IfcIO.Scene 0.11.1, RvtIO.Scene 0.4.0. The -0.0 bound replaces -0, which nuget.org refuses in a dependency (it refused IfcIO.Scene 0.11.0 for it; Recommend a range for IOScene that nuget.org accepts IOScene#3 changed the contract).
  • tools/pack-release.ps1 removes packages left in the output folder by an earlier run, then checks the packed packages before anything is published, as the engines do: the IOViewer package must exist and depend on IOScene with a lower bound that exists and is not a preview, and no package may have a dependency bound that nuget.org refuses.
  • README, CONTRIBUTING (local feed section and release notes), docs/getting-started.md, THIRD-PARTY-NOTICES.md (IfcIO 0.11.1): the new range, version and exit code. docs/index.md, SECURITY.md (scope) and the bug report template list the IFC and Revit inputs.

Repository (earlier commits of this PR)

  • 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 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

In 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_ExitCode_IsFourOnlyWhenTheAdapterReportedAnError: no diagnostics, warnings and info give 0; an error gives 4.
  • Cli_ConvertRvtToHtml_ReadsTheModelThroughRvtIO: runs only when IOVIEWER_RVT_FILE names a Revit 2022 file, skipped otherwise; no Revit file is committed. It expects exit code 4 when the tool printed an engine error and 0 otherwise, so the release check works on any Revit file and pins the code end to end.
  • CliTests: the help assertion follows the new usage line.

Run with an empty NuGet package folder, so IOScene 0.1.0, IfcIO/IfcIO.Scene 0.11.1 and RvtIO/RvtIO.Scene 0.4.0 all came from nuget.org:

  • dotnet build IOViewer.slnx -c Release: 0 warnings, 0 errors.
  • dotnet test IOViewer.slnx -c Release: 120 tests on each of net8.0 and net10.0, 119 passed, 1 skipped (the RVT test without IOVIEWER_RVT_FILE). With IOVIEWER_RVT_FILE set to a private Revit 2022 sample the RVT test passed on both TFMs (exit code 0) before the review fixes; since then it takes the expected exit code from RvtSceneReader diagnostics and has not been run again with a Revit file.
  • tools/pack-release.ps1 (Windows PowerShell 5.1; the release job uses pwsh): exit 0; IOViewer.0.3.0 depends on IOScene [0.1.0, 0.2.0-0.0). Its dependency check, run on its own against crafted packages, passes the released range and a tool package without dependencies, and refuses -0, a preview or missing IOScene lower bound, a missing IOScene and a bound with metadata.
  • No customer models, personal data or vendor code is added; the engines and their dependencies are listed in THIRD-PARTY-NOTICES.md.
  • Not run: the release workflow (it runs only on the tag v0.3.0).

Known limitations (not changed here)

  • An I/O error while writing the output (a locked file, a read-only folder) is not caught for the JSON outputs and the output folder, so the tool ends with an unhandled exception instead of exit code 3.
  • With --serve, the tool reaches its exit code only when the preview server fails to start; it then returns 0 (or 4) after printing the server error.

After merge

Tag v0.3.0 on the merge commit; the release publishes IOViewer and IOViewer.Cli 0.3.0. The CHANGELOG date is 2026-11-13; if the tag is pushed on a later day, the date should be corrected first.

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
IOScene is referenced as [0.1.0, 0.2.0-0.0): nuget.org refuses the bound -0
in a dependency. IfcIO.Scene 0.11.1 and RvtIO.Scene 0.4.0 are the released
adapters. Version 0.3.0; the changelog section 0.3.0 takes the entries of
[Unreleased].

When an engine adapter reports an error (elements may be missing), ioviewer
still writes the requested output and exits with code 4; warnings keep 0. The
Revit test expects 4 when an engine error was printed and 0 otherwise.

pack-release.ps1 checks the packed packages as the engines' scripts do: the
IOViewer package must exist and depend on IOScene with a lower bound that is
present and not a preview, and no dependency bound may be one nuget.org
refuses. README, CONTRIBUTING, SECURITY, the docs and the bug report template
describe the new range, version, exit code and inputs.
@mahach666 mahach666 changed the title feat(cli): read IFC and RVT input through IfcIO.Scene and RvtIO.Scene feat(cli): read IFC and RVT input through IfcIO.Scene and RvtIO.Scene; release 0.3.0 Nov 13, 2026
@mahach666
mahach666 marked this pull request as ready for review November 13, 2026 01:51
Adapter diagnostic messages quote element names from the model file. The
CLI now replaces control characters (escape sequences, line breaks) with
'?' before writing them to standard error, so a crafted file cannot
inject terminal sequences or forge an extra "Error:" line.

The Revit test takes the expected exit code from the diagnostics of
RvtSceneReader instead of parsing standard error. CliTests and
ModelAndCliIntegrationTests share the "Console" test collection, so
their redirections of the process-wide console no longer race.
…acters

Engine exceptions can quote names or tokens from the model file, and the
CLI printed them as they were when a load or an export failed. Those
messages now go through the same Printable helper as the adapter
diagnostics. The helper also replaces format characters (Unicode
category Cf, such as the bidirectional overrides U+202E and U+2066),
which make a terminal show the line in a different order than it was
written.
…packages

- IOViewer.Cli keeps NU1904 (a critical advisory) as an error; only low,
  moderate and high advisories against an engine dependency are warnings,
  since the engines parse untrusted files.
- tools/pack-release.ps1 removes .nupkg and .snupkg files left in the
  output folder by an earlier run before it packs, so the dependency
  check and the push see only this version. The checks are named
  instead of labelled (b) and (c).
- Printable walks runes, so format characters above U+FFFF (such as the
  invisible tag characters) are replaced too.
- The usage line lists input.ifczip.
@mahach666
mahach666 merged commit 4c21ca7 into main Nov 13, 2026
5 checks passed
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