Table of Contents

Workflow: Shaping the Mission around the Process

This page is how to lay out a project's mission: the entries a new project starts with, one List command per operation family in the order the process runs, and the HTTP routes that build it one entry at a time. It is section 3 of Project Construction, where the mission goes in after the machine, workpiece, controller and tools (Ordering a Project Build to Avoid Rework) and before the replay that says a project is finished. The sign-in, the reply envelope and the key-based editing these routes rely on are Driving the Web Service over HTTP.

What a new project starts with

A new project arrives with a mission already in it: the five Setup commands, two Program File entries naming the placeholders NC/NC-File-Name-1.nc and NC/NC-File-Name-2.nc, and a Post-Execution with every output off. Each placeholder raises the error RunNcFile--NotFound on every play and is skipped, and an entry added through POST /api/Mission/list-command/entries without an insert index lands after them — below the Post-Execution, which writes only what has played above it, so nothing that entry plays reaches its outputs; with nothing played above it either, its writers end on StepFile-Write--NoFile and ShotFile-Write--NoFile (for the outputs switched on). Pass "InsertIndex" with the Post-Execution's current index to put a program above it — 5 once the two placeholders are deleted — or move the Post-Execution to the end afterwards with POST /api/Mission/list-command/entries/{path}/move and {"Direction": "to", "TargetIndex": <last index>}. Edit the seeded entries, or delete them with DELETE /api/Mission/list-command/entries/{path} from the last index down — the paths after a deleted entry renumber — and read the result back with GET /api/Mission/list-command/entries.

One List per operation family, in process order

A flat list of program files runs correctly but reads badly and gives you one knob for the whole job. Group the programs into one List command per operation family, in the order the process actually runs:

Machining Motion Resolution
Collision Detection      [Off]
Pause on Failure         [Off]
Physics                  [On]
Record Meshed Geometry   Read On First Or Write · Cache/0-stock.wct         (STL stock only)
▸ 1 · Drilling                    Machining Resolution 0.5 mm
      centre drill, drill
      Record Meshed Geometry      Read On First Or Write · Cache/1-drilling-done.wct
▸ 2 · Outside roughing            Machining Resolution 0.5 mm
      roughing 1 … 5
      Record Meshed Geometry      Read On First Or Write · Cache/2-outside-roughing-done.wct
▸ 3 · Outside finishing           Machining Resolution 0.2 mm
      finishing 1 … 7
      Record Meshed Geometry      Read On First Or Write · Cache/3-outside-finishing-done.wct
▸ 4 · Pocket roughing             Machining Resolution 0.5 mm
  …
▸ 8 · Deburring                   Machining Resolution 0.2 mm
Post-Execution                    geometry diff on

Why this shape:

  • The records are part of the shape, not an optimisation. Where the stock is an STL, keep a Record Meshed Geometry entry above the first group: the stock is meshed before the first line of NC plays, at the workpiece's Initial Resolution, and for a finely tessellated STL that costs minutes on every play until it is cached. Close each group with an end-of-stage record named after the group, so a later run can resume from any of them. The cached stock does not follow a later change to the stock geometry or its Initial Resolution until its file is deleted. A Mission That Resumes is the layout in full.
  • Grouping must not reorder. The stock evolves from one operation to the next, so the sequence is load-bearing. Group adjacent operations; never sort the list into tidy families if that moves an operation past another one.
  • Each group carries its own machining resolution. Roughing is about force, not surface, so a coarse resolution is enough and runs quickly. Finishing, rib and deburring passes leave the final surface with small and ball cutters and deserve a finer one. Setting the resolution mid-mission only changes the value the act runner cuts with — the workpiece is not rebuilt, and the geometry container is adaptive — so alternating coarse and fine between groups is safe.
  • A group is a switch. Disabling one List skips a whole phase, which is how you re-run just the finishing passes without deleting anything.
  • Iterate on a short program; keep the full job beside it, switched off. A replay of the whole job is the acceptance run, not the debugging loop. While datums, tools and offsets are still moving, play a derived main program that runs one representative piece of the job — for four identical parts held on one fixture plate, the block that machines the first part — in a List of its own, and keep the full program in a second List with its checkbox cleared; PUT /api/Mission/commands/{path}/enabled with a body of true or false flips which one runs. Put the stage-0 record at root level above both groups so either variant starts from the same cached stock, and give each variant its own end-of-stage file. The first plays of a new project are the ones most likely to produce no steps or to cut in the wrong place, and a one-part program shows that in a fraction of the time.
  • Budget the fine groups. Machining resolution drives the cost of subtracting material, not the number of simulation steps — the step count follows the motion resolution and does not change. On one 33-operation job, refining the finishing groups from 0.5 mm to 0.2 mm left the step count identical and multiplied wall-clock time by about 2.8. Decide the finish resolution with that trade-off in view, and say what it costs in the project's README so nobody is surprised.
  • Setup commands are granular. Machining resolution, motion resolution, collision detection, pause-on-failure and physics are separate commands, so each can sit exactly where it should take effect — global ones at the top, per-phase ones inside a group.
Tip

A project that loads an ideal (target) geometry and never compares against it is unfinished. Turn on the geometry diff in the Post-Execution command so a full replay ends by measuring the machined stock against the finished part. A diff with no target to compare against does nothing and still reports that it was built — Geometry Validation says how to tell.

Building the mission over HTTP

Over HTTP the mission is built one entry at a time. POST /api/Mission/list-command/entries adds at the root and POST /api/Mission/list-command/entries/{path} inside a list, with a body of {"CommandType": "<kind>", "IsEnabled": true} and an optional "InsertIndex"; the reply's path is the new entry's address for every later call. A path is the chain of indices joined by dots — 6 is the seventh root entry, 6.1 the second entry inside it. The values the routes expect:

What Values
CommandType the command's class name without Command, lower-cased: list, ncfile, manualtooling, nccode, script, machiningresolution, machiningmotionresolution, collisiondetection, pauseonfailure, physics, recordmeshedgeom, postexecution, exportmeshedgeom, ncoptoption; GET /api/Mission/command-catalog lists the ones this service can add
List title PUT /api/Mission/commands/{path}/listcommand with {"Title": "…"}
Program file PUT /api/Mission/commands/{path}/ncfile with the project-relative path as a JSON string
Manual Tooling PUT /api/Mission/commands/{path}/fields/toolId with the tool number
On/off Setup commands PUT /api/Mission/commands/{path}/fields/enable with true or false
Feedback Mode PUT /api/Mission/commands/{path}/fields/feedbackMode with true or false, on the Physics command; it takes effect with that command's enable on, when the run reaches the command
Machining resolution PUT /api/Mission/commands/{path}/fields/machiningResolution_mm with a number
Motion resolution PUT /api/Mission/commands/{path}/machiningmotionresolution/type with "feedpercycle", "feedpertooth" or "fixed"
Record Meshed Geometry PUT /api/Mission/commands/{path}/recordmeshedgeom/main-action with "ReadOnFirstOrWrite", and …/rel-file with the cache file
Post-Execution one PUT /api/Mission/commands/{path}/postexecution/… route per value: enable-write-step-files and enable-write-shot-files with true or false, step-file-template and shot-file-template with the template as a JSON string, relative to the project folder, shot-file-time-resolution-ms with a number, enable-geom-diff with true or false; GET /api/Mission/commands/{path} reads them back

GET /api/Mission/commands/{path}/fields lists a command's field keys when the one you need is not in the table. Post-Execution has none: its fields list is empty, and its values go through the postexecution/… routes above.

See Also