Expand description
In-app scratch scripts. Source is saved only on request and never on a model.
Structs§
Constants§
- WINDOW_
ID - The window’s egui id — one name for the panel, the tests and the host.
Statics§
- HIT_
KEYS - The hit keys this window publishes under
__brepJavascriptHit(seeautomation::hit_keys);panel:clipis the key every scrolling pane publishes for its visible region, soclick_widgetcan wheel a row into view.
Traits§
- Script
Host - Where Run sends a program when the app has a script runner: the app’s
own server’s code mode (
crate::mcp::EditorHost), the same worker, limits andsdk.<namespace>.<action>functions an agent’srunprogram gets. Without one (the web build, a bare test harness) Run uses the plugin runner’s editor action.
Functions§
- program
- An editor script as a program for the
ScriptHost: both are plain script bodies with top-levelawaitandreturn, andsdk(every app command asawait sdk.<namespace>.<action>(args)) is the runner’s global. The editor adds its own names around the body:cad.document(the history snapshot withaddFeature(type, params, persistentData),updateFeature(id, params)(a merge, asfeature_set_paramsmerges) anddeleteFeature(id)),cad.selection,cad.sdk(the samesdk) andui.notify. The document commands apply in order after the body returns, and a returned value prints asResult:. One leadingimport … from "@brep/cad"line is dropped, as the runner drops it.