Coordinate > Clash Reports

Clash Excel

Writes a styled Excel report of the chosen clash tests: a summary in Clash Detective's colours, then one sheet per test with a thumbnail of each clash, filters and frozen headers.

Tab and panelCoordinate > Clash Reports
KindButton
Live whenThe model has clash tests

Status

Untested Never executed inside Navisworks. Passed the headless checks only.

Related asks to confirm

No quote is on record yet. These threads look related, but a person still has to open and read them.

Events it listens to

None. It runs only when you click it.

Files

Paths are relative to the Playground.extension folder.

  • Coordinate.tab/Clash_Reports.panel/Clash_Excel_Report.pushbutton/bundle.yaml
  • Coordinate.tab/Clash_Reports.panel/Clash_Excel_Report.pushbutton/icon.dark.png
  • Coordinate.tab/Clash_Reports.panel/Clash_Excel_Report.pushbutton/icon.png
  • Coordinate.tab/Clash_Reports.panel/Clash_Excel_Report.pushbutton/icon.small.dark.png
  • Coordinate.tab/Clash_Reports.panel/Clash_Excel_Report.pushbutton/icon.small.png
  • Coordinate.tab/Clash_Reports.panel/Clash_Excel_Report.pushbutton/script.py

Install

  1. Only this tool. In Navisworks, click pyNavis > Playground, search for Clash Excel, 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. Clash Excel is on the Coordinate tab, Clash Reports 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.

Coordinate.tab/Clash_Reports.panel/Clash_Excel_Report.pushbutton/script.py View on GitHub
# -*- coding: utf-8 -*-
"""Writes a styled Excel clash report: a summary, then one sheet per test with a row (and thumbnail) per clash."""
from pynavis import script, toast

from namo import clashrep_forms as cf
from namo import clashreport as cr
from namo import rep_clash_excel as rep
from namo import ui

TITLE = 'Clash Excel Report'
DEFAULTS = {'tests': [], 'statuses': list(cr.OPEN), 'images': True, 'open': True}


def run():
    values = script.get_config(DEFAULTS)
    if cf.runner_active():
        cf.run_saved('clash_excel', values)
        return
    doc = cr.active_doc()
    problem = cf.start(doc)
    if problem:
        toast.show(*problem)
        return
    tests = cf.pick_tests(TITLE, 'Tick the tests to report.', values['tests'], doc)
    if tests is None:
        return
    if not tests:
        toast.info('No clash results yet', 'Run your clash tests in Clash Detective first.')
        return
    path = cr.default_path(rep.NAME_TEMPLATE, 'xlsx', doc)
    answers = ui.form(TITLE, cf.excel_fields(values, path), ok='Create', validate=cf.need_status, width=520)
    if answers is None:
        return
    cap = cr.IMAGE_CAP
    if answers['images']:
        cap = cf.ask_images(TITLE, tests, answers['statuses'])
        if cap is None:
            return
    values.update({'tests': cf.test_paths(tests), 'statuses': answers['statuses'], 'images': answers['images'],
                   'open': answers['open']})
    script.save_config(values)
    config = {'tests': values['tests'], 'statuses': answers['statuses'],
              'images': bool(answers['images']) and cap != -1, 'image_cap': max(0, cap), 'path': answers['path']}
    result = cf.run_report('clash_excel', config, TITLE, doc)
    if result is None:
        return
    toast.show(result['level'], result['message'], result['detail'])
    if answers['open'] and result['paths'] and result['level'] in ('success', 'warning'):
        try:
            ui.open_path(result['paths'][0])
        except Exception:
            toast.warning('Could not open the workbook', 'Open it from %s.' % result['paths'][0])
    elif not answers['open']:
        cf.reveal(result)


run()

Library modules this tool uses

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

  • namo.clashrep_formsThe questions the Clash Reports buttons ask, in one place.
  • namo.clashreportClash reports: the row shaping, summaries and tallies every Clash Reports tool shares.
  • namo.rep_clash_excelClash Excel Report: one styled workbook for the chosen clash tests.
  • 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.

Coordinate.tab/Clash_Reports.panel/Clash_Excel_Report.pushbutton/bundle.yaml View on GitHub
title: Clash\nExcel
tooltip: Writes a styled Excel report of the chosen clash tests: a summary in Clash Detective's colours, then one sheet per test with a thumbnail of each clash, filters and frozen headers.
context: clash-tests