pyNavis panel
Reload
Rescan every extension folder and rebuild the ribbon, without restarting Navisworks.
What it does#
Reads every extension folder again and rebuilds the pyNavis tab from what it finds. New
bundles appear, renamed ones move, changed captions, tooltips, icons and shortcuts take
effect, and each extension's startup.py runs again. Editing a tool and clicking
Reload is the whole development loop.
How to use it#
- Change something on disk: a new folder, an edited
bundle.yaml, a new icon. - Click Reload. A toast says when the tab is rebuilt.
- Click your button. A script edit alone does not even need this:
script.pyis read fresh on every click.
Limitations#
- Three things need a Navisworks restart instead: a changed engine path, a
*.libfolder added or removed, and new dock panel slots. - Reload rebuilds pyNavis' tab only. Other add-ins are untouched.
- Open dock panels are repainted with fresh controls; a panel that was mid-edit loses the edit.
Good to know#
Reload writes ==== pyNavis reload ==== to
%APPDATA%\pyNavis\logs\pyNavis.log and then lists every bundle it skipped and
why, so a button that fails to appear is one log line away from an explanation.
Source#
The tool's own files, word for word as shipped in pyNavis.panel/Reload.pushbutton. Every pyNavis tool is an ordinary bundle: copy these into your own extension and change what you like.
script.py Runs on a click. View on GitHub"""Rescan extension folders and rebuild the pyNavis ribbon (no restart needed)."""
from pynavis import toast
__pynavis__.Reload()
toast.success('pyNavis ribbon reloaded.')