Model > Data

External Data Link

Links a spreadsheet to this document by a key column (Element ID, GUID or a property) and writes its columns to a custom tab on the matched objects. Refresh re-reads the file and reports matched, unmatched and changed; links are saved with the document's Playground data.

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/External_Data_Link.pushbutton/bundle.yaml
  • Model.tab/Data.panel/Write_Data.pulldown/External_Data_Link.pushbutton/icon.dark.png
  • Model.tab/Data.panel/Write_Data.pulldown/External_Data_Link.pushbutton/icon.png
  • Model.tab/Data.panel/Write_Data.pulldown/External_Data_Link.pushbutton/icon.small.dark.png
  • Model.tab/Data.panel/Write_Data.pulldown/External_Data_Link.pushbutton/icon.small.png
  • Model.tab/Data.panel/Write_Data.pulldown/External_Data_Link.pushbutton/script.py

Install

  1. Only this tool. In Navisworks, click pyNavis > Playground, search for External Data Link, 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. External Data Link 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/External_Data_Link.pushbutton/script.py View on GitHub
# -*- coding: utf-8 -*-
"""Manages spreadsheet links that write their columns to custom tabs on matched objects."""
from pynavis import script, toast

from namo import data_common, data_write, ui


def run():
    if ui.is_runner():
        toast.info('External Data Link 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.link_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/External_Data_Link.pushbutton/bundle.yaml View on GitHub
title: External Data Link
tooltip: Links a spreadsheet to this document by a key column (Element ID, GUID or a property) and writes its columns to a custom tab on the matched objects. Refresh re-reads the file and reports matched, unmatched and changed; links are saved with the document's Playground data.
context: doc