Write any model table (build from scratch)
civil_write_tablesCreates, changes or deletes rows in any CIVIL NX database table through the MIDAS API — nodes, elements, materials, sections, thicknesses, supports, links, load cases, loads, groups, stages, combinations, anything the API manual lists — so a model can be built from scratch or changed where no plugin tool does it. Look up the table and its fields first with midas_docs_search / midas_docs_read (e.g. "db/ELEM"), and read the current rows with civil_read_table. writes is a list of steps run in order: { table, op: create (POST — new keys only, refused if a key exists) | upsert (PUT — creates or changes; GRUP lists and CNLD/BMLD/PRES/RIGD items MERGE, they are never removed by a PUT) | delete (DESTRUCTIVE — needs allowDestructive; a node takes its elements, an element its loads, a load case its loads), rows: { "": {fields} } | ids: [keys] }. The preview simulates every step over the current model: what each creates, changes (which fields) and deletes; it blocks keys that already exist on create, elements that refer to nodes, materials, sections or thicknesses that do not exist (CIVIL NX accepts a missing section silently), deletes and UNIT / MVCD writes without allowDestructive. Then apply: true with confirmPlanHash writes the steps (stopping at the first refusal), reads every touched row back and reports anything not stored as sent. civil_write_tables_undo puts every touched row back.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"writes": "<writes>"
},
"name": "civil_write_tables"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apply | No | Write to CIVIL NX. Only after the user approved the preview. | |
| writes | Yes | ||
| confirmPlanHash | No | planHash from the approved preview; refused if the model or the steps changed. | |
| allowDestructive | No | DESTRUCTIVE: allow delete steps and writes to UNIT / MVCD. Only after the user agreed to what the preview says they do. |