Model > Data

Model Tree Export

Exports the selection tree to a chosen depth (4 by default) as an Excel workbook with a sheet per model: each node's depth, name, class, descendants, geometry items and hidden state, indented and one column per level so it filters in Excel.

Tab and panelModel > Data
KindButton
Live whenA model is open

Status

Launched Ran inside Navisworks at least once with no error logged; nobody checked the result yet.

Ran headless under pynavis run against a sample model; no selection: ran to the end: 'Exported 25 tree nodes from 1 model'; result not checked by a person.

Recorded on 2026-10-09. The evidence is a pynavis run transcript.

The public ask

No public source is on record for this tool.

Installs with

Model Tree Export sits in a stack, so installing it also installs:

Events it listens to

None. It runs only when you click it.

Files

Paths are relative to the Playground.extension folder.

  • Model.tab/Data.panel/Data_Tools.stack/Model_Tree_Export.pushbutton/bundle.yaml
  • Model.tab/Data.panel/Data_Tools.stack/Model_Tree_Export.pushbutton/icon.dark.png
  • Model.tab/Data.panel/Data_Tools.stack/Model_Tree_Export.pushbutton/icon.png
  • Model.tab/Data.panel/Data_Tools.stack/Model_Tree_Export.pushbutton/icon.small.dark.png
  • Model.tab/Data.panel/Data_Tools.stack/Model_Tree_Export.pushbutton/icon.small.png
  • Model.tab/Data.panel/Data_Tools.stack/Model_Tree_Export.pushbutton/script.py

Install

  1. Only this tool. In Navisworks, click pyNavis > Playground, search for Model Tree Export, tick it and click Install.
  2. The whole extension. Download Playground.extension.zip, unzip it, put the Playground.extension folder in %APPDATA%\pyNavis\extensions\, and click pyNavis > Reload. Model Tree Export is on the Model tab, Data panel.

You need pyNavis 1.3.0 or later.

Tried it? Tell us whether it worked or not. That report is what moves a tool up the status ladder.

Report

Source

The tool's own files, word for word as published in pynavis/Playground. Paths are relative to the Playground.extension folder.

script.py

The script that runs on a click.

Model.tab/Data.panel/Data_Tools.stack/Model_Tree_Export.pushbutton/script.py View on GitHub
# -*- coding: utf-8 -*-
"""Exports the selection tree to a chosen depth as an Excel workbook, one sheet per model."""
from pynavis import script, toast

from namo import data_common, items, progress, reports, ui
from namo import rep_model_tree as rep

DEFAULTS = {'depth': rep.DEFAULT_DEPTH, 'models': [], 'open': True}


def run():
    if ui.is_runner():
        result = reports.run('model_tree', script.get_config(DEFAULTS), interactive=False)
        if not result.get('cancelled'):
            toast.show(result['level'], result['message'], result['detail'])
        return
    doc = data_common.active_doc()
    if not data_common.has_models(doc):
        data_common.no_model_toast()
        return
    values = script.get_config(DEFAULTS)
    names = [m['name'] for m in items.models(doc)]
    chosen = [n for n in values.get('models') or [] if n in names] or names
    fields = [{'kind': 'int', 'key': 'depth', 'label': 'Depth', 'default': int(values.get('depth') or 4),
               'min': 0, 'max': 20, 'hint': '0 is the model files themselves; 4 usually reaches Revit types.'},
              {'kind': 'multi', 'key': 'models', 'label': 'Models', 'options': names, 'default': chosen},
              {'kind': 'check', 'key': 'open', 'label': 'Open the workbook when done',
               'default': bool(values.get('open'))}]
    answer = ui.form('Model Tree Export', fields, ok='Export')
    if answer is None:
        return
    if not answer['models']:
        toast.info('No models ticked', 'Tick at least one model to export.')
        return
    config = {'depth': answer['depth'], 'models': answer['models'], 'open': bool(answer['open'])}
    script.save_config(config)
    path = data_common.ask_save('{file} - Model tree - {date}', 'xlsx', 'Export the model tree', doc)
    if path is None:
        return
    run_config = dict(config, path=path, models=[] if len(answer['models']) == len(names) else answer['models'])
    result = progress.run('Model Tree Export', lambda report: reports.run(
        'model_tree', run_config, doc=doc, interactive=True, progress=report))
    if result is progress.CANCELLED or result.get('cancelled'):
        return
    toast.show(result['level'], result['message'], result['detail'])
    if config['open'] and result.get('paths') and result['level'] in ('success', 'warning'):
        try:
            ui.open_path(result['paths'][0])
        except Exception as error:
            toast.warning('Could not open the workbook', str(error))


run()

Library modules this tool uses

From the shared namo library, which installs with every tool. Each name opens the module on GitHub.

  • namo.data_commonShared plumbing for the Inspect and Data panel tools: progress stages, where files go by default, the scope dialog fields, and the small checks every button starts with.
  • namo.itemsModel items: walking, collecting, identifying, measuring and showing them.
  • namo.progressGlue between pyNavis' cancellable progress window and Playground's progress callbacks.
  • namo.rep_model_treeModel Tree Export: the selection tree to depth N as an Excel workbook, one sheet per model, each node with its depth, name, class, descendant and geometry counts and whether it is hidden; names indented by depth and repeated in one column per level so the tree filters and pivots in Excel.
  • namo.reportsThe registry of automation-ready reports, and the helpers every report shares.
  • namo.uiWPF building blocks for Playground tools, themed from the pyNavis design system.

bundle.yaml

The bundle contract: the keys pyNavis reads for this tool.

Model.tab/Data.panel/Data_Tools.stack/Model_Tree_Export.pushbutton/bundle.yaml View on GitHub
title: Model Tree Export
tooltip: Exports the selection tree to a chosen depth (4 by default) as an Excel workbook with a sheet per model: each node's depth, name, class, descendants, geometry items and hidden state, indented and one column per level so it filters in Excel.
context: doc