Vis Automations · In-app tool, Automation Scripts menu

Model Inspector

A Python tool that Vis lists in its own Automation Scripts menu: it attaches to the open session, reads every part, selects the largest, retitles the view, adds a snapshot and writes a report.

Verification NOT fully passing on Vis 2606.0 build 26134 + 2606.2610 · 2026-10-29 · repo tc-vis-automation 9f1b0af · The tool, the menu launch and restart persistence work; registration by registry does not.

The Automation Scripts menu

The menu is at ☰ Menu › Automation Scripts: the classic menu button under the ribbon, not a ribbon tab. It lists the scripts in an XML profile and runs the chosen one with ShellExecute, so a .py runs through the Windows .py association (py.exe). Setting TCVIS_DISABLE_AUTOMATION_SCRIPT_MENU=True hides the menu. The mechanism was first DERIVED from strings in Program\VisLinkList.dll; the menu launch itself is now EXERCISED.

The profile format (EXERCISED)

The profile follows XMLSchema_AutomationScripts.xsd: AutomationScripts › VisGroup › VisScript with ScriptName, ScriptType (Python, VB Script, VB Script (IE), Microsoft .NET, C++, Other) and ScriptLocation. The profile Vis saved itself from the Manage Scripts dialog was byte-for-byte this format apart from its name, so the XML was never the problem.

<AutomationScripts NumChildren="1" Title="Claude Tools">
  <VisGroup GroupName="Claude Tools" NumChildren="1">
    <VisScript ScriptName="Claude Model Inspector" ScriptType="Python">
      <ScriptLocation>C:\path\model_inspector.py</ScriptLocation>
    </VisScript>
  </VisGroup>
</AutomationScripts>

Attaching back to the session

The script calls win32com.client.dynamic.Dispatch("VFFrame.Application"). Vis is not in the running-object table, so GetActiveObject fails, but Dispatch reaches the running session rather than starting a new one: the VisView_NG pid is the same before and after. Everything the tool does then lands in the user’s own window.

Respecting the user’s view

A model opened from the GUI shows 0 visible nodes until AllNodesOn(). The tool only calls it when nothing at all is visible, so a user’s own hide and show state is kept.