Model > Data

Bulk Property Writer

Writes up to 10 custom properties to the selected items in one step, merged into an existing tab, or writes a spreadsheet's columns to the objects its Element ID, GUID or property column matches, with a preview of matched, unmatched and ambiguous rows first.

Tab and panelModel > Data
KindButton
Live whenA model is open

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.

  • Model.tab/Data.panel/Write_Data.pulldown/Bulk_Property_Writer.pushbutton/bundle.yaml
  • Model.tab/Data.panel/Write_Data.pulldown/Bulk_Property_Writer.pushbutton/icon.dark.png
  • Model.tab/Data.panel/Write_Data.pulldown/Bulk_Property_Writer.pushbutton/icon.png
  • Model.tab/Data.panel/Write_Data.pulldown/Bulk_Property_Writer.pushbutton/icon.small.dark.png
  • Model.tab/Data.panel/Write_Data.pulldown/Bulk_Property_Writer.pushbutton/icon.small.png
  • Model.tab/Data.panel/Write_Data.pulldown/Bulk_Property_Writer.pushbutton/script.py

Install

  1. Only this tool. In Navisworks, click pyNavis > Playground, search for Bulk Property Writer, 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. Bulk Property Writer 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/Write_Data.pulldown/Bulk_Property_Writer.pushbutton/script.py View on GitHub
# -*- coding: utf-8 -*-
"""Writes custom properties to the selection, or from a spreadsheet matched to model items."""
from pynavis import script, toast

from namo import data_common, data_write, ui


def run():
    if ui.is_runner():
        toast.info('Bulk Property Writer needs the Navisworks window', 'It cannot open under pynavis run.')
        return
    doc = data_common.active_doc()
    if not data_common.has_models(doc):
        data_common.no_model_toast()
        return
    data_write.bulk_flow(script.bind(), doc)


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.data_writeThe Write Data pulldown's dialogs and flows: Bulk Property Writer, Find and Replace, Property Mapper and External Data Link. The logic they rest on (planning, matching, mapping, writing inside one transaction) is namo.propwrite; this module asks, previews and reports. Every flow takes the BoundScript `me` (settings) and the document, returns nothing and toasts every outcome; cancelling any dialog is silent.
  • 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/Write_Data.pulldown/Bulk_Property_Writer.pushbutton/bundle.yaml View on GitHub
title: Bulk Property Writer
tooltip: Writes up to 10 custom properties to the selected items in one step, merged into an existing tab, or writes a spreadsheet's columns to the objects its Element ID, GUID or property column matches, with a preview of matched, unmatched and ambiguous rows first.
context: doc