Skip to content

The export phase in Python and the viewer, as rvt-ifc --phase has it #1339

Closed

Description

@DrunkOnJava

Since #1328, an export leaves out a room whose own phase is not the export phase, and the elements that do not exist in it (RE-184). The export phase is the project's last unless rvt-ifc --phase <name|id> names another, as Revit's exporter does by default.

Only rvt-ifc has that option today:

On a renovation model whose rooms sit in an earlier phase, a Python or viewer user cannot get those rooms back. Only the diagnostics count says how many were left out.

Change

Add the same option everywhere, on top of #1331's single export function:

  • Python: a phase: str | int | None = None argument on every export entry point and on the diagnostics, matching names exactly first, then ElementIds. An unknown phase raises ValueError listing the file's phases. The type stubs (python/rvt/__init__.pyi) and docs/python.md follow.
  • Viewer: the export options take a phase, and the UI lists the file's phases with the last one as the default. The wasm binding gains the parameter, and docs/viewer-api.md follows.
  • Defaults stay as they are (the last phase), so existing calls export the same bytes.

Done when

  • A Python E2E and a viewer test on RE1 Architecture match the rvt-ifc E2E. --phase "New Construction" and its ElementId give the default bytes, Existing leaves the 11 rooms out, and an unknown phase is an error that lists the phases.
  • The semver and stub checks show additions only.

Depends on #1331.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:pythonarea:viewerpriority:P2type:feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions