Coordinate > Clash Reports

Per-Trade Reports

Writes one clash workbook (and an optional dashboard) per responsible trade into a folder, with an index, using Clash Assigner's who-moves list for unassigned clashes.

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

Status

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

The public ask

No public source is on record for this tool.

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/Per_Trade_Reports.pushbutton/bundle.yaml
  • Coordinate.tab/Clash_Reports.panel/Per_Trade_Reports.pushbutton/icon.dark.png
  • Coordinate.tab/Clash_Reports.panel/Per_Trade_Reports.pushbutton/icon.png
  • Coordinate.tab/Clash_Reports.panel/Per_Trade_Reports.pushbutton/icon.small.dark.png
  • Coordinate.tab/Clash_Reports.panel/Per_Trade_Reports.pushbutton/icon.small.png
  • Coordinate.tab/Clash_Reports.panel/Per_Trade_Reports.pushbutton/script.py

Install

  1. Only this tool. In Navisworks, click pyNavis > Playground, search for Per-Trade Reports, 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. Per-Trade Reports 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/Per_Trade_Reports.pushbutton/script.py View on GitHub
# -*- coding: utf-8 -*-
"""Writes one clash workbook (and an optional dashboard) per responsible trade into a folder, with an index."""
import os

from pynavis import script, toast

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

TITLE = 'Per-Trade Reports'
DEFAULTS = {'tests': [], 'statuses': list(cr.OPEN), 'html': False, 'images': False, 'folder': '',
            'subfolder': True}


def run():
    values = script.get_config(DEFAULTS)
    if cf.runner_active():
        cf.run_saved('per_trade', 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 split by trade.', 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
    priority, _people = rep.assigner_settings()
    folder = values['folder'] if values['folder'] and os.path.isdir(values['folder']) else cr.doc_folder(doc)
    answers = ui.form(TITLE, cf.per_trade_fields(values, folder, priority), ok='Write', validate=cf.need_status,
                      width=560)
    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'], 'html': answers['html'],
                   'images': answers['images'], 'folder': answers['folder'], 'subfolder': answers['subfolder']})
    script.save_config(values)
    config = {'tests': values['tests'], 'statuses': answers['statuses'], 'html': answers['html'],
              'images': bool(answers['images']) and cap != -1, 'image_cap': max(0, cap),
              'folder': answers['folder'], 'subfolder': answers['subfolder']}
    result = cf.run_report('per_trade', config, TITLE, doc)
    if result is None:
        return
    toast.show(result['level'], result['message'], result['detail'])
    if result.get('folder') and result['level'] in ('success', 'warning'):
        try:
            ui.open_path(result['folder'])
        except Exception:
            toast.warning('Could not open the folder', result['folder'])


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_per_tradePer-Trade Reports: one clash workbook (and optionally one dashboard) per responsible trade, plus an index workbook, into one folder.
  • 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/Per_Trade_Reports.pushbutton/bundle.yaml View on GitHub
title: Per-Trade\nReports
tooltip: Writes one clash workbook (and an optional dashboard) per responsible trade into a folder, with an index, using Clash Assigner's who-moves list for unassigned clashes.
context: clash-tests