Project > Field

Field Checklists

Inspection checklists attached to saved viewpoints: Pass, Fail or N/A with notes per item, inspector, date and sign-off, stepping from viewpoint to viewpoint, with an HTML and Excel report. Shift+Click edits the team's templates.

Tab and panelProject > Field
KindButton
Live whenThe model has saved viewpoints

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.

  • Project.tab/Field.panel/Field_Checklists.pushbutton/bundle.yaml
  • Project.tab/Field.panel/Field_Checklists.pushbutton/config.py
  • Project.tab/Field.panel/Field_Checklists.pushbutton/icon.dark.png
  • Project.tab/Field.panel/Field_Checklists.pushbutton/icon.png
  • Project.tab/Field.panel/Field_Checklists.pushbutton/icon.small.dark.png
  • Project.tab/Field.panel/Field_Checklists.pushbutton/icon.small.png
  • Project.tab/Field.panel/Field_Checklists.pushbutton/script.py

Install

  1. Only this tool. In Navisworks, click pyNavis > Playground, search for Field Checklists, 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. Field Checklists is on the Project tab, Field 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.

Project.tab/Field.panel/Field_Checklists.pushbutton/script.py View on GitHub
# -*- coding: utf-8 -*-
"""Opens the inspection checklist of the current saved viewpoint: Pass, Fail or N/A per item, notes and sign-off."""
from pynavis import toast

from namo import checklists, config as namo_config, field_checklistwin, fourd_common, ui


def run():
    if ui.is_runner():
        toast.info('Field Checklists is a window', 'Run it from the ribbon.')
        return
    doc = fourd_common.active_doc()
    views = checklists.viewpoint_list(doc)
    if not views:
        toast.info('No saved viewpoints', 'Save a viewpoint for each place you inspect, then open Field Checklists.')
        return
    records = checklists.records_store(doc)
    field_checklistwin.show(doc, records, views, checklists.available_templates(),
                            checklists.current_guid(doc), namo_config.user_name())
    if records.note:
        toast.info('Checklists from local data', records.note)


run()

config.py

The Shift+Click action.

Project.tab/Field.panel/Field_Checklists.pushbutton/config.py View on GitHub
# -*- coding: utf-8 -*-
"""Edits the team's checklist templates: new, change, delete (the QA and safety examples can be copied)."""
from pynavis import forms, toast

from namo import checklists, ui

TITLE = 'Checklist templates'
NEW = '(new template)'


def validate_items(text):
    try:
        checklists.parse_template_text(text)
    except ValueError as error:
        return str(error)
    return None


def run():
    if ui.is_runner():
        return
    store = checklists.templates()
    team = store.names()
    every = checklists.available_templates()
    options = [NEW] + sorted(every)
    picked = forms.select_from_list(options, title=TITLE, prompt='Pick a template to change or copy.')
    if picked is None:
        return
    builtin = picked in checklists.BUILTIN and picked not in team
    config = every.get(picked) or {'text': '# Section\nFirst item to check'}
    text = checklists.template_text(checklists.template_items(config)) if picked != NEW else config['text']
    name = '' if picked == NEW else ('%s (team copy)' % picked if builtin else picked)
    fields = [
        {'kind': 'text', 'key': 'name', 'label': 'Name', 'default': name, 'required': True},
        {'kind': 'text', 'key': 'description', 'label': 'Description', 'default': config.get('description', '')},
        {'kind': 'textarea', 'key': 'text', 'label': 'Items, one per line; # starts a section', 'rows': 14,
         'default': text, 'validate': validate_items},
    ]
    if picked in team:
        fields.append({'kind': 'check', 'key': 'delete', 'label': 'Delete this template instead', 'default': False})
    intro = ('A built-in example: saving makes a team copy.' if builtin
             else 'Checklists already attached keep their answers; new items are added when you reopen them.')
    answer = ui.form(TITLE, fields, intro=intro, ok='Save', width=600)
    if answer is None:
        return
    if answer.get('delete'):
        if not forms.confirm('Delete the checklist template %s for everyone who shares it?' % picked, title=TITLE):
            return
        store.delete(picked)
        toast.success('Deleted the checklist template', picked)
        return
    if picked in team and answer['name'].strip() != picked:
        store.delete(picked)
    stored = store.save(answer['name'], {'text': answer['text'], 'description': answer['description']})
    count = len(checklists.parse_template_text(answer['text']))
    toast.success('Saved the checklist template %s' % stored, '%d items.' % count)


run()

Library modules this tool uses

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

  • namo.checklistsField Checklists: inspection checklists attached to saved viewpoints.
  • namo.configPlayground-wide settings: one JSON file shared by every Playground tool.
  • namo.field_checklistwinField Checklists window: the checklist of one saved viewpoint at a time.
  • namo.fourd_commonHelpers the 4D, Quantities and Field tools share: scopes, default files, text.
  • 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.

Project.tab/Field.panel/Field_Checklists.pushbutton/bundle.yaml View on GitHub
title: Field\nChecklists
tooltip: Inspection checklists attached to saved viewpoints: Pass, Fail or N/A with notes per item, inspector, date and sign-off, stepping from viewpoint to viewpoint, with an HTML and Excel report. Shift+Click edits the team's templates.
context: viewpoints