pyNavis panel
Console
An interactive Python console running inside Navisworks, with the same API and helpers your scripts get.
On the ribbonButton, pyNavis panel
NeedsNothing
What it does#
Opens a window where you type Python and run it against the open model, in the same
process and with the same pynavis library the ribbon tools use. It is the
fastest way to answer "what does this API call return on this model" before writing it into
a tool, and a handy calculator for one-off jobs that do not deserve a button.
Screenshot to comeconsole-window.png
How to use it#
- Click Console. It opens with no document and with one alike.
- Type in the lower pane. Run with Ctrl+Enter or the Run button. Output collects in the upper pane.
- Up and Down at the edges of the input walk back through what you have already run.
- Start with
from pynavis import selection, toastandselection.get_items(): the list you get back is the same one every tool starts from.
Limitations#
- It is a console, not an editor: there is no file, no save, and history lives for the session only. Anything worth keeping belongs in a bundle.
- Code runs on the Navisworks UI thread, like every tool. A long loop freezes the window until it finishes.
- The IronPython engine runs here. A bundle that needs numpy runs on CPython and cannot be tried in this console.
Other uses#
- Count something the interface will not: items in the selection by category, saved viewpoints per folder, clash results per status.
- Try a search condition and see what it matches before building a selection set.
Good to know#
The Python API reference lists every helper available here. If you find yourself pasting the same lines twice, the quickstart shows how to turn them into a button in five minutes.