One command catalog,
three front-ends.
Every automation command is written once and becomes available to your C# code, to end-user JavaScript macros and to AI assistants at the same time — with the same undo, events and validation as interactive work.
Written once, available everywhere.
The same undo transactions, the same events and the same validation as interactive work — whoever issues the command.
Scroll sideways to see the whole diagram.
Safe for users, ready for AI, built to last.
Safe for end users
Strict-mode sandbox, no .NET access, only JSON crosses the boundary. Time, memory, statement and CAD-operation budgets; files and host resources denied unless your application approves.
Ready for AI assistants
Claude and other MCP clients can discover the catalog, run commands, atomic batches and whole macros, and look at viewport and sheet captures to check their work.
Built to last
Self-describing commands, stable error codes and entity IDs, and a versioned public contract that only grows by addition. Your host can add its own script functions.
Every automation capability.
Open an area to read what it covers.
01Language & APIJavaScript with a cad API to draw, modify and query the drawing, transactions that undo as a single step, and a geometry library written in JavaScript.3 capabilities
- A geometry library written in JavaScript provides points, vectors, transforms, planes, segments and lines for computing construction geometry inside the script, and turns points into command parameters.
- A command that fails raises a JavaScript error with a stable code that the macro can catch and handle, and log() writes output lines for the user.
- The host application can add its own functions to the macro language, which macros call under the host object with the same budgets, cancellation and error codes as CAD commands.
02Sandbox & safetyMacros see only the macro API, commands that reach outside the drawing are refused unless the host allows them, every run has limits on time and operations, and the user can stop a macro with Esc.5 capabilities
- Macros run in an embedded JavaScript engine that sees no .NET objects and reaches the CAD only through the macro API, which passes plain data in both directions, with eval and new Function disabled.
- Commands that reach outside the drawing, such as opening, saving, importing or exporting files, are refused to macros unless the host allows them, either for good or by confirming each call.
- Every run is bounded by limits the host can adjust (run time, executed statements, memory, recursion depth, CAD operations and created entities), and crossing any of them, runaway recursion included, stops the macro with a stable error code instead of crashing the application.
- The user stops a running macro with Esc and the host can cancel it from code, in which case the CAD operation in progress completes and no new one starts.
- Whatever the outcome, a transaction the macro left open is rolled back and the drawing is refreshed, so a failed or cancelled run never leaves a half-applied undo step.
03User interactionA macro can ask the user for points, entities, numbers and texts while it runs.5 capabilities
- A macro can pause to ask the user for a point, an entity (optionally limited to given types), a number or a text, through the CAD's normal prompts with object snaps and construction aids.
- It can also collect an open series of points ended with Enter, or a declared sequence of points, entities, numbers and texts answered in a single session, with an elastic line drawn from the previous point.
- Pressing Esc during a request raises an error the macro can catch to take another path, each request can time out, and the time the user spends answering does not count against the macro's time limit.
- A macro can also work on the entities the user selected before starting it and leave its results selected for the next command.
- The host switches interactive input on for each run and can answer the requests with its own provider, for example in automated tests, while a run without a user gets a dedicated error code instead.
04Running & libraryMacros run from the host's code with a structured result, on a background thread or without any window, and from a catalogue of saved macros that the host can offer as commands.5 capabilities
- A host runs a macro from code and gets back a structured result with success or a stable error code, the value of the last expression as JSON, the logged lines, the operations attempted, the entities created and the elapsed time.
- A hosted run executes on a background thread so the interface stays responsive, with drawing commands and grip editing locked until the macro ends.
- A windowless run shows the lines a macro logs as the application's standard messages and reports any failure as an error message, one macro at a time.
- A catalogue of saved macros, kept in a JSON file with portable paths, gives each one a command name, a script, a description and an icon, with names checked against the application's commands so that the host can offer every macro as a command.
- A deterministic mode seeds the random number generator and fixes the clock, so that a run can be repeated exactly, for example as a test.
05AI assistant connectionAn MCP server that runs in its own process and connects to the open CAD session, with one configuration shared by both sides.5 capabilities
- The MCP server runs as a separate program that the MCP client starts over standard input and output, and it talks to the CAD on the same computer through a module that the host application starts with one call.
- Both sides read one shared configuration (connection name, time limits, diagnostics, macro limits, start and shutdown options) from a per-user or per-machine file over built-in defaults, and the server can write a commented template.
- The assistant can start the CAD when it is not running, optionally only if the executable carries a valid CadWare signature, and can stop it when the configuration allows it.
- Every request has a time limit, so a CAD that does not answer returns an error to the assistant instead of leaving it waiting.
- One CAD instance serves a connection name at a time, further instances can run under names of their own, and the assistant is warned when the process answering it changes.
06Commands for AIA catalogue of commands that describe themselves to the assistant: drawing, editing, queries, constraints, sheets, variables and views, plus running a JavaScript macro in one step.10 capabilities
- Assistants draw lines, polylines, arcs, circles, rectangles, texts and hatches, and add linear, aligned, angular, radial, diametric, baseline and continued dimensions and centre marks, on the layer of their choice.
- Assistants change the layer, colour and line type of entities, delete them, move, rotate, scale, mirror, copy and array them, trim, extend, offset, fillet, chamfer, join, explode and stretch them, create, change and delete layers, and undo or redo steps.
- Assistants break curves between two points or at one point, lengthen lines and arcs, align entities by pairs of source and destination points, and divide or measure curves with points or blocks.
- Assistants change the draw order of overlapping entities (to the front or back, or just above or under another entity) in one undo step.
- Assistants query the drawing (entities filtered by type, layer or area, their geometry, distances, intersections, snap points, the overall extents and the current selection), set the selection, and receive a picture of the viewport as an image.
- Assistants receive a picture of the application's own windows, open menus and dialogs included, drawn by the windows themselves so that nothing else on the screen appears, with the geometry needed to click on what it shows.
- Assistants add geometric constraints and driving dimensions, change, suppress or remove them, read the degrees of freedom left, and manage document variables whose expressions set driving dimensions and feature parameters.
- Assistants switch to standard views, zoom, split the drawing area into viewports, set the work plane, the drawing units and the annotation defaults, read the document state, save and open EYE files, and import or export DWG and DXF.
- Assistants create, copy, reorder, rename and remove layout sheets, place, move, rescale, lock and rebuild views of the whole model or of a region of it, choose what each view hides, fill in title blocks and page setups, and export sheets to PDF.
- Assistants annotate sheets with texts and linear dimensions, which inside a view measure the model, and, when the application hosts the paper space, capture a sheet as an image and print sheets on an installed printer unless the host vetoes the print.
07DiagnosticsA health check of the open document, diagnostic commands that are enabled on demand, and logs on both sides.2 capabilities
- A test command that raises an error on purpose, available only when diagnostics are switched on in the configuration, confirms that failures reach the assistant and the log.
- The server program can also send a single request from a command prompt, such as a ping or a list of entities, to test the connection without an assistant.
083D automationSolid commands and parametric features available to the automation API, to JavaScript macros and to the MCP server.7 capabilities
- Code, macros and AI assistants can create boxes, spheres, cylinders and planar surfaces on the current work plane, and unite, subtract or intersect existing solids without a feature history.
- Every parametric feature type can be created from code, with holes sized from metric presets and fillets or chamfers placed on edges by their number in the solid's topology.
- Features can be listed, read, edited by parameter name, suppressed, renamed, reordered, rolled back, spliced into a chain or removed from code, under the same rules as the feature history and with the reason when a change is refused.
- From code, the solids built by features can be listed with their features, named and rolled back one at a time, and every feature reports the solid it belongs to and why it is rolled back.
- Queries return a solid's numbered faces and edges, the chain of tangent edges that a fillet on a given edge would round, and an estimate of the solid's volume, surface area and centroid.
- From code, the work plane can be placed on a planar face of a solid and stays attached to it as with the interactive command, and the attached work planes can be listed with their current state.
- The 3D commands join the automation catalogue at run time when the 3D automation assembly is deployed and the open document is 3D, and without them automation keeps working in 2D.
Have a CAD problem worth solving?
Tell us what you're building. We'll give you a clear assessment of whether we're the right team, and how we'd approach it.
sales@cadwaresoft.com