Variables: the drawing's values, worked out
POST /variables runs the template with the values given and returns its variables' values: the labelled ones
(as given, or the template's own) and those worked out from them, such as a blank's size or a material's
allowances. Each comes as a value (a number, text, or true or false) and as drawing text. ?labelledOnly=true gives
only the labelled ones. What the template printed (PRINT) comes back too.
The body is a template (as template, or as source from one of your storages) and values for its labelled variables, as described on the API page.
Example
POST /variables?labelledOnly=true
X-API-KEY: your-api-key
Content-Type: application/json
{
"template": "L=400,\"Length\"\nW=300,\"Width\"\nP1=[L,0]\nP2=[L,W]\nP3=[0,W]\nPOLYLINE @1,[P0,P1,P2,P3],TRUE,0",
"values": { "L": 500, "W": 250 }
}
{
"variables": [
{ "name": "L", "label": "Length", "value": 500, "text": "500", "isInput": true },
{ "name": "W", "label": "Width", "value": 250, "text": "250", "isInput": true },
{ "name": "D", "label": "Depth", "value": 300, "text": "300", "isInput": true }
],
"printed": []
}
isInput is true for the labelled variables (those values can be given for). A value that isn't a number, text or
true or false (a point, say) comes as null, with its text.