Model > Inspect
What Is It
Everything Navisworks knows about one item in one card: identity, Revit IDs, source file and tree path, size and position, geometry, colour and state, and every property tab. Select the item first, or click it in the view when nothing is selected. A plain-text summary goes to the clipboard.
Status
Launched Ran inside Navisworks at least once with no error logged; nobody checked the result yet.
Ran headless under pynavis run against a sample model; 17 parts selected: ran to the end (wrote output); result not checked by a person (stubbed: namo.ui.copy).
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.
Model.tab/Inspect.panel/What_Is_It.pushbutton/bundle.yamlModel.tab/Inspect.panel/What_Is_It.pushbutton/icon.dark.pngModel.tab/Inspect.panel/What_Is_It.pushbutton/icon.pngModel.tab/Inspect.panel/What_Is_It.pushbutton/icon.small.dark.pngModel.tab/Inspect.panel/What_Is_It.pushbutton/icon.small.pngModel.tab/Inspect.panel/What_Is_It.pushbutton/script.py
Install
- Only this tool. In Navisworks, click pyNavis > Playground, search for What Is It, tick it and click Install.
- The whole extension. Download
Playground.extension.zip, unzip it, put thePlayground.extensionfolder in%APPDATA%\pyNavis\extensions\, and click pyNavis > Reload. What Is It is on the Model tab, Inspect 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.
ReportSource
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/Inspect.panel/What_Is_It.pushbutton/script.py View on GitHub# -*- coding: utf-8 -*-
"""Shows everything Navisworks knows about the selected or clicked item in one card."""
from pynavis import output, toast
from namo import data_common, inspect, items, picking, ui
def target(doc):
"""(item, picked point or None, selection count), or (None, None, 0) when there is
nothing to inspect (already reported) or the pick was cancelled (silent)."""
selected = items.selected(doc)
if selected:
return selected[0], None, len(selected)
if ui.is_runner():
toast.info('Nothing selected', 'Select an item: clicking a point needs the Navisworks window.')
return None, None, 0
# The click runs on the host's Measure tool, like every shipped pyNavis pick; the
# point is then resolved to the front-most item under it.
hit = picking.point('Click the item to inspect', want_item=True, doc=doc)
if hit is None:
return None, None, 0 # Esc, right-click or another tool: say nothing
if hit.item is None:
toast.info('Nothing under that point', 'Click on model geometry, or select an item first.')
return None, None, 0
# A click lands on a geometry leaf (often an unnamed solid); the card is about the
# element it belongs to, which is where the Revit tabs live.
return items.object_of(hit.item), hit.point, 1
def run():
doc = data_common.active_doc()
if not data_common.has_models(doc):
data_common.no_model_toast()
return
item, picked, count = target(doc)
if item is None:
return
info = inspect.describe(item, doc, picked)
name = info.get('name') or info.get('class_name') or 'Item'
output.set_title('What Is It: %s' % name)
output.print_html(inspect.card_html(info))
detail = 'Summary copied to the clipboard.'
if not ui.copy(inspect.summary_text(info)):
detail = 'The clipboard was busy; the card is in the output window.'
if count > 1:
detail = 'First of %s selected items. %s' % ('{:,}'.format(count), detail)
toast.success('Inspected %s' % name, detail)
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.inspectInspecting single items: What Is It, Copy IDs, Open in Explorer, Properties Plus.namo.itemsModel items: walking, collecting, identifying, measuring and showing them.namo.pickingThe one way a Playground tool asks for a click in the 3D view.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/Inspect.panel/What_Is_It.pushbutton/bundle.yaml View on GitHubtitle: What\nIs It
tooltip: Everything Navisworks knows about one item in one card: identity, Revit IDs, source file and tree path, size and position, geometry, colour and state, and every property tab. Select the item first, or click it in the view when nothing is selected. A plain-text summary goes to the clipboard.
shortcut: Ctrl+Alt+I
context: doc