Modex - Modelica Editor with AI
Diagram, icon, and text editor for Modelica models with AI-powered modeling, editing, and simulation

Modex brings a full-featured, synchronized diagram + icon + text editing experience for Modelica models directly into VS Code.


Features
- Build with AI — any coding agent connects to Modex via MCP. Describe a system and get a complete diagram — components, parameters, and wiring.
- AI Popover — double-click anywhere on the canvas to summon AI. Create components, edit parameters, and search the library instantly.
- Diagram Editor — drag-and-drop component placement, connection routing, and visual annotation editing for Modelica models (
.mo files).
- Icon Editor — edit component icons with shape primitives and coordinate transforms.
- Text Editor — syntax-highlighted Modelica text editing with live diagnostics, synchronized with the graphical views.
- Simulation — configure, run, and inspect OpenModelica simulations from within VS Code (requires a local OpenModelica installation).
- Plotting Workbench — interactive time-series plots for simulation results.
- 3D Animation — play back VisXML / multi-body animations from simulation output.
- Library Management — browse, install, and manage Modelica libraries from the OpenModelica package index.
- AI Assistant — a full agent sidebar and
@modex chat participant for model editing, analysis, and simulation through local agents, GitHub Copilot, local models, or your own provider API keys.
- Modelica Debugger — step through simulation execution with GDB-based equation debugging.
Requirements
- VS Code 1.125.0 or later
- OpenModelica (optional) — required for simulation and debugging. Library installation works without OpenModelica. Set
modex.simulation.omcPath or ensure omc is on your PATH (see Installing OpenModelica (OMC)).
- An AI runtime or provider (optional) — Claude Code and Codex are auto-detected when installed. You can also use GitHub Copilot, a local OpenAI-compatible endpoint, or your own key for a supported API provider.
Getting Started
- Install the extension from the VS Code Marketplace.
- Open a folder containing
.mo files, or create a new one.
- Open any
.mo file — the Modex Diagram Editor opens by default.
- Use the Modex sidebar (activity bar) to browse libraries, workspace models, simulation runs, and plots.
Installing OpenModelica (OMC)
Simulation and debugging need the OpenModelica Compiler (omc). Most users install OpenModelica with the official installer. On Linux — or any managed environment where a system-level install is inconvenient — you can also get omc from conda.
How Modex finds omc
Modex resolves the compiler in this order:
- The
modex.simulation.omcPath setting, if it points at an executable omc.
- The
OPENMODELICAHOME environment variable ($OPENMODELICAHOME/bin/omc).
omc on your PATH.
So you can leave modex.simulation.omcPath empty whenever omc is already on your PATH — for example inside an activated conda environment. Set the path explicitly only to pin a specific build.
Using conda
The conda-forge package is omcompiler and provides the omc executable:
conda install -c conda-forge omcompiler
Verify it is available (run this in the same shell where the environment is activated):
omc --version
If that prints a version, Modex will auto-detect it — leave modex.simulation.omcPath empty.
Important: the environment must be activated in the shell that launches VS Code, so VS Code inherits the updated PATH. Activate the environment, then start VS Code from that terminal with code .. If you launch VS Code from a desktop icon instead, the conda PATH is usually not inherited — in that case set modex.simulation.omcPath to the environment's omc directly, e.g. ~/miniconda3/envs/<env>/bin/omc.
Note: the conda-forge omcompiler package is currently Linux-only. On macOS and Windows, use the official OpenModelica installer instead — or, on Windows, run OMC inside WSL (below).
How this differs from WSL
With WSL, you run the extension host inside a Linux distribution via the WSL extension ("Reopen in WSL"). OMC is then installed inside the distro — via the Linux installer or via conda — and modex.simulation.omcPath (if set) refers to a Linux path inside the distro (e.g. /usr/bin/omc), not a Windows path. The same PATH/OPENMODELICAHOME detection applies, just evaluated inside WSL. Conda on the host (Windows) and conda inside WSL are independent; install omcompiler in whichever one runs the extension host.
Troubleshooting
- "OpenModelica Compiler (omc) not found" — confirm
omc --version works in the shell that launched VS Code. If it works in a terminal but Modex still can't find it, VS Code did not inherit your PATH; either relaunch via code . from the activated shell or set modex.simulation.omcPath to the absolute path of omc.
- After changing
PATH, the environment, or the setting, run Developer: Reload Window so the new value is picked up.
- On macOS/Windows, prefer the official installer; conda's
omcompiler is Linux-only.
Extension Settings
| Setting |
Default |
Description |
modex.simulation.omcPath |
"" |
Path to omc executable (auto-detected if empty) |
modex.ai.provider |
"auto" |
Preferred AI provider; configure providers and credentials from Modex: Open Agent Settings |
modex.ai.model |
"" |
Override model ID for the AI provider |
modex.ai.claudeCode.executablePath |
"" |
Path to claude CLI executable (auto-detected if empty) |
modex.ai.claudeCode.allowedAgentTools |
["Read", ...] |
Claude-native tools auto-allowed without user confirmation |
modex.ai.claudeCode.disallowedAgentTools |
["Bash", ...] |
Claude-native tools auto-denied |
modex.libraryIndexUrl |
"" |
Custom library index URL (defaults to OpenModelica public index) |
modex.libraryRoots |
[] |
Additional directories containing Modelica library packages |
modex.managedLibraryRoot |
"" |
Directory for installed third-party libraries |
modex.systemLibraries |
[] |
Additional system libraries to load on startup |
modex.loadLatestModelica |
true |
Auto-load the latest Modelica Standard Library |
modex.proposal.expiryMinutes |
15 |
Minutes before an AI-proposed edit expires |
Commands
All commands are prefixed with Modex: in the Command Palette. Key commands:
- Switch to Text Editor / Diagram View / Icon View — toggle between editing modes
- Simulate / Cancel Simulation
- Open Simulation Results / Open Animation
- Install Library / Upgrade Libraries / Refresh Library Index
- Set AI Provider API Key / Clear AI Provider API Key
- New Figure / Save as Figure
Known Issues
- This is a Preview release. Some features may be incomplete or contain bugs.
- Simulation and debugging features require a local OpenModelica installation.
- Large models may experience slower initial rendering.
For bug reports, installation problems, feature requests, usage questions, or documentation feedback, please use the GitHub issue tracker (or email if you prefer). Discord is best for informal community discussion.
License
See the LICENSE file included with this extension for the full license agreement.
Privacy
Modex does not add its own product telemetry. AI features send the prompt and selected model context to the runtime or provider you choose; provider SDKs and local agent products may collect data under their own terms. See the bundled PRIVACY.md for details.
Third-Party Software
See the THIRD_PARTY_NOTICES.md file included with this extension for third-party license notices.