An interactive IronPython shell and script editor that runs inside Alibre Design and connects to the live modeling session through the AlibreX and AlibreScript APIs.
The add-on opens a split window with an AvalonEdit script editor on top and an IronPython 2.7 REPL below. Code typed in either pane runs against the active Part, Assembly, or Drawing session. It builds as a .NET Framework 4.8.1 (x64) add-on and references Alibre Design 29.0.0.29060.
- What Is Here
- Official Alibre Resources
- Requirements
- Quick Start
- Installation
- Usage
- Key Files
- Key Folders
- Notes
- License
- An IronPython 2.7 console (REPL) that executes code against the active Alibre session in real time.
- A split-pane window: an AvalonEdit script editor on top and the live console below, separated by a draggable splitter.
- Run the whole script or just the selected text from the editor with the Run button or F5.
- The current session is exposed to the console as the
csvariable, and the AlibreScript API is imported at startup. - Code completion with a side completion list and Tab-key insertion and cycling, plus Python syntax highlighting.
- An editor toolbar for open, save, undo, redo, cut, copy, paste, word wrap, line numbers, and end-of-line markers, and a Clear action on the console.
- A dark themed UI, with a dark title bar on Windows 10 and later.
- Menu entry enabled in Part, Assembly, and Drawing sessions.
Alibre's official resources for API development and AI/LLM/agent workflows: https://www.alibre.com/api/
- Alibre Design (built and referenced against version 29.0.0.29060).
- .NET Framework 4.8.1 (x64).
- IronPython 2.7.10.
- Build
source/AlibrePythonShellAddonV2.slnin Release configuration. - Register the add-on with the
AlibrePythonShellAddonV2.adcmanifest (see Installation). - Restart Alibre Design, open a Part, Assembly, or Drawing, and launch the add-on from its menu entry.
- Build
source/AlibrePythonShellAddonV2.slnin Release configuration. - Copy the build output, the
AlibrePythonShellAddonV2.adcmanifest, and the bundled Python files (IronPythonConsole.pyandAlibrePython/) into an Alibre Design add-ons folder. - The
.adcmanifest registers the add-on as loaded at startup and adds an "Alibre Python Shell Addon V2" menu entry. - Restart Alibre Design so the add-on loads.
- Open a Part, Assembly, or Drawing in Alibre Design.
- Launch the add-on from its "Alibre Python Shell Addon V2" menu entry to open the shell window.
- Type Python in the lower console and press Enter to run it interactively, or write a script in the upper editor and press F5 (or Run) to run all of it or the current selection.
- Use the
csvariable to reach the current session, and the AlibreScript API for modeling operations.
| File | Purpose |
|---|---|
source/AlibrePythonShellAddonV2.sln |
Visual Studio solution for the add-on. |
source/AlibrePythonShellAddonV2.adc |
Alibre add-on manifest: registers the DLL, menu text, and add-on identifier (GUID). |
source/AlibreAddOn.cs |
Add-on entry points (AddOnLoad, GetAddOnInterface) that Alibre calls on load. |
source/AlibrePythonShellAddonV2.cs |
IAlibreAddOn implementation: menu tree, per-session menu state, and launching the shell window. |
source/Form1.cs |
WinForms host window that embeds the WPF control and applies the dark title bar. |
source/Form1.Designer.cs |
Designer layout for the host window, including the WPF ElementHost. |
source/MainUserControl.xaml |
Split editor-and-console layout, toolbar, and completion list. |
source/MainUserControl.xaml.cs |
UI logic: run, file open/save, code completion, and binding the cs session variable. |
source/IronPythonConsole.py |
Startup script that adds Alibre Design paths and imports AlibreX and AlibreScript. |
source/AlibrePython/__init__.py |
Package init that imports AlibreX and the AlibreScript API. |
source/Resources/Python.xshd |
Python syntax highlighting definition for the editor. |
| Folder | Purpose |
|---|---|
source/ |
Add-on C# project, solution, manifest, and Python startup files. |
source/PythonConsoleControl/ |
WPF IronPython console control project: REPL host, completion, and highlighting. |
source/AlibrePython/ |
Python package imported into the console at startup. |
source/Resources/ |
Editor resources, including the Python highlighting definition. |
documentation/ |
Placeholder for documentation (currently empty). |
reviews/ |
Code review notes. |
submodules/ |
Placeholder for git submodules (currently empty). |
.github/ |
This README, contribution guide, and issue and pull request templates. |
- The IronPython runtime is 2.7.10, so scripts should stay Python 2.7 compatible.
IronPythonConsole.pyhard-codes Alibre Design paths underC:\Program Files\Alibre Design 29.0.0.29060; adjust them for a different install location or version.- The add-on references Alibre Design 29.0.0.29060; other versions are untested.
- The console needs a Part, Assembly, or Drawing session open to bind the
csvariable.
See LICENSE.
Alibre, Alibre Design, and Alibre Script names and related materials belong to their respective owners.