pyACAD panel
Reload
Rescan every extension folder and rebuild the pyACAD ribbon, without restarting AutoCAD.
On the ribbonButton, pyACAD panel
NeedsNothing
Command
PYRELOADShortcutNone set (bind one in Shortcuts)
What it does#
Reads every extension folder again and rebuilds the pyACAD tabs from what it finds. New
bundles appear, removed ones go, changed captions, tooltips, icons, keytips and shortcuts
take effect, every tool's AutoCAD command is registered again, dock panels are rebuilt, and
each extension's startup.py and app-init hook run again. Editing a
tool and clicking Reload is the whole development loop. The command is
PYRELOAD.
How to use it#
- Change something on disk: a new bundle folder, an edited
bundle.yaml, a new icon, a file inpyacadlib. - Click Reload. A toast says when the ribbon is rebuilt.
- Click your button. A script edit alone does not even need this:
script.pyis read fresh on every run.
Good to know / limits#
- Two things need an AutoCAD restart instead: a changed engine path, and a
*.libfolder added or removed (Reload says so in a toast). Edits to files already inside a*.libfolder are picked up. - Dock panels are rebuilt from scratch: the Layer Manager forgets its filter text and selection. The Ask AI conversation is kept.
- Open pyACAD toasts close.
- Only pyACAD's own tabs are rebuilt. Other add-ins are untouched.
- If the ribbon is broken badly enough that this button is not there, type
PYACADRELOAD: the loader defines it, so it exists even when no extension loaded.
Other uses#
- Pick up an edit to the
pyacadlibrary itself: library modules stay cached between runs, and Reload is what refreshes them. - Reload writes
==== pyACAD reload ====to%APPDATA%\pyACAD\logs\pyACAD.log, followed by 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 pyACAD.panel/Reload.pushbutton. Every pyACAD 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 pyACAD ribbon (no restart needed)."""
from pyacad import toast
__pyacad__.Reload()
toast.success('pyACAD ribbon reloaded.')