Evaluate: expressions worked out in the drawing
POST /evaluate runs the template with the values given, then works out each expression sent, as the
Interactive window in ParametrIQ CAD does: L*2, DISTANCE(P1,P4), LENGTHOF(@3), AREAOF(@1),
BENDALLOWANCE(90,R,K,T) … Only expressions are worked out: a command (a LINE, an assignment) is refused, so
nothing in the drawing is changed.
The body is that of Drawing, and expressions: a list of 1 to 1000.
Example
POST /evaluate
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 },
"expressions": [ "L*2", "DISTANCE(P0,P2)", "AREAOF(@1)", "NOPE(" ]
}
[
{ "name": "L*2", "label": null, "value": 1000, "text": "1000", "isInput": false },
{ "name": "DISTANCE(P0,P2)", "label": null, "value": 559.0169943749474, "text": "559.016994", "isInput": false },
{ "name": "AREAOF(@1)", "label": null, "value": 125000, "text": "125000", "isInput": false },
{ "name": "NOPE(", "label": null, "value": null, "text": "line 1:6 unexpected token …", "isInput": false }
]
Each comes back in the order sent, the expression as its name. One that can't be worked out has a value of null,
and text says why; the others are still worked out.
See also: API, Variables, Expressions.