EzyCad scripting (Lua and Python)
EzyCad can embed Lua and (on supported builds) Python consoles. They share the same idea: run short snippets against live ezy.* and view.* bindings while the app is running.
Availability
Lua |
Python |
|
|---|---|---|
Desktop (Windows) |
Always (built-in Lua library) |
Only if the app was built with Python enabled ( |
WebAssembly |
Yes |
No (not shipped in the browser build). |
Opening the consoles
View -> Lua Console - Toggles the Lua console and script editor tabs.
View -> Python Console - Same layout for Python when the feature is compiled in.
Visibility is remembered with other panes (see usage.md -> Help and Settings).
Layout
Output / history - Results and errors from executed lines.
Input line - Enter a fragment and run it (same as a one-off at the interactive prompt).
Script tabs - Files under
res/scripts/lua(*.lua) orres/scripts/python(*.py) are loaded as editable buffers; Lua scripts are also run on startup so you can define helpers (seebasic.lua/basic.py).
Paths are relative to the app working directory on desktop; on WASM, Lua scripts are under the preloaded /res/scripts/lua tree.
Bindings overview
Use ezy.help() or help() in either console for the built-in reminder text.
ezy
Method |
Purpose |
|---|---|
|
Print to the console and the main Log pane |
|
Show a status message (same style as GUI messages) |
|
Current application mode name (string) |
|
Switch mode by name |
|
Print binding summary |
view
Method |
Purpose |
|---|---|
|
Number of sketches |
|
Number of 3D shapes |
|
Name of the current sketch |
|
Add primitive shapes |
|
Shape by 1-based index: Lua userdata or |
|
Camera vectors: |
|
Set camera vectors |
Lua only: global print is routed to ezy.log.
Python only: print is similarly redirected to ezy.log after bootstrap.
Sample scripts
res/scripts/lua/basic.lua- Defineskv(obj)to dump tables or list userdata methods viaezy.log.res/scripts/python/basic.py- Exampledump_view()usingezy.logandview.
Copy these as templates for your own files in the same folders.
Limitations
The API is small and may change between versions; prefer
ezy.help()after upgrades.Scripting is for automation and inspection, not a full replacement for the GUI workflow.
Heavy work in the console thread can block the UI; keep snippets short.
For general application behavior, see usage.md.