pyACAD panel

Shortcuts

The shortcuts and aliases editor: every pyACAD tool that can carry a chord or an alias, what it has now, and fields to change both.

On the ribbonButton, pyACAD panel
NeedsNothing
CommandPYSHORTCUTS
ShortcutNone set (bind one here)

What it does#

Any pyACAD tool can have a keyboard shortcut and short aliases to type. The shipped tools come with no shortcuts bound, so you choose your own, and with an alias each, like BX for Blocks to Excel, which you can change. This editor lists every tool that can take them, from every loaded extension, grouped by panel and searchable, and lets you set, clear or restore each one. Your choices are stored in config.json under shortcuts.bindings and aliases; a tool's own defaults (its shortcut: and alias: in bundle.yaml) are never touched, so a reset always has something to go back to. The command is PYSHORTCUTS.

How to use it#

  1. Click Shortcuts. Type in the search box to narrow the list: it matches the tool's title, its panel's title, its command, and the chord and aliases it has.
  2. Click the field on a row and press the keys you want, for example Ctrl+Shift+B. The field shows the chord and the row reads custom. A chord pyACAD cannot use is refused and the field goes back to what it was.
  3. Backspace in a field clears the binding, and the row reads disabled if the tool had a default of its own. Esc leaves the field as it was.
  4. A chord already held by a tool earlier in ribbon order is flagged under the later row: conflicts with and the other tool's name. Save stays greyed until every conflict is resolved.
  5. Type in the Alias field to change a tool's aliases, for example BX, or BX, B2X for two. Clear it to have none. An alias that another tool holds, that is in your acad.pgp (like CO for COPY), or that AutoCAD already has as a command is flagged in red under the row, and Save stays greyed: your existing keystrokes keep their meaning.
  6. A customised row of a tool that ships its own default has a small reset arrow that puts the default back. Restore All Defaults at the bottom does it for every row at once.
  7. Click Save (enabled once something changed). pyACAD reloads so the new chords and aliases are live straight away, and a toast confirms it.

Good to know / limits#

  • A chord always runs the tool's primary action, never its Shift+Click one, and it sends the tool's command exactly as a click does.
  • Chords fire only when the AutoCAD window is in front and the keyboard focus is not in a text box, so typing at the command line or in a palette's filter box is never hijacked.
  • A pyACAD chord wins over an AutoCAD keyboard shortcut on the same keys. Bind Ctrl+Shift+S and Save As is gone from the keyboard until you clear it.
  • Unless Settings allows bare keys, a chord must include Ctrl or Alt.
  • Dock panels (Layer Manager, Ask AI) are not listed: they are reached with their keytip (Alt, then the letters shown on the ribbon).
  • Bindings are keyed by the tool's folder path inside its extension. Moving a tool to another panel drops its override.
  • Saving writes the bindings of the tools that are loaded now. If an extension folder is missing when you save (an unplugged network drive, say), the chords you had given its tools are dropped.

Other uses#

  • Give the two or three tools you use daily a chord each, so they are a keypress away without leaving the drawing.
  • Find out whether any extension you installed binds a chord you rely on: search for the chord's letter and read the rows.

Source#

The tool's own files, word for word as shipped in pyACAD.panel/Shortcuts.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
"""View and change pyACAD keyboard shortcuts and aliases (writes config.json overrides)."""
import clr

clr.AddReference('PyAcad.Runtime')
from PyAcad.Runtime.Forms import ShortcutsDialog

from pyacad import toast

if ShortcutsDialog.ShowAndSave():
    __pyacad__.Reload()
    toast.success('Shortcuts and aliases saved and applied.')
bundle.yaml The bundle contract: the keys pyACAD reads for this tool. View on GitHub
title: Shortcuts
tooltip: View and change keyboard shortcuts, and the short aliases you type to run each tool