Interactive
The Interactive window is where you type commands: to draw, to edit, to set variables and points, and to work things out. Open it from the menu, View › Panels › Interactive; it docks below the drawings.
Every command here is also how the drawing is saved: a drawing file is a list of these commands, one per line (a block over as many as it takes, and a statement over more than one inside brackets), so what you type is exactly what the drawing file holds.

Using it
- Click in the Command box at the bottom of the window.
- Type a command, such as
LINE P0,P2, or an expression, such asDISTANCE(P0,P2). - Press Enter or click Go.
To run several statements at once, paste them in (as many lines as you like), or press Shift+Enter to start a new
line, then press Enter or click Go. Several can also go on one line, separated by ;
(P4=[100,0] ; LINE P0,P4), and a statement can go on over the end of a line inside brackets. They run one after
another, each shown as it runs; if one can't be read or carried out, the reason is shown in red and the rest aren't
run. What ran is undone in one step.
To run a file, click … (Browse) and choose a drawing (.piq) or a script saved as one: its statements are put in
the box and run at once, into the drawing that is open, just as if you had pasted them.
What you typed is added to the list above the box, and:
- A command is carried out on the drawing. If it can't be, the reason is shown in red, and nothing changes.
- An expression on its own is worked out, and shown with its value in grey:
DISTANCE(P0,P2) → 640.312424. - A line that starts with
//is a comment: it is added to the list and nothing else happens. A comment can also follow a command on its line (LINE P0,P2 // the diagonal): the command is carried out, and the comment ignored. - A command that can't be read is said in plain words in red ("There is no variable, point or command called TUCKK.
Did you mean TUCK?"), the parser's own message, with a
^under the place where reading stopped, under Details. Show me puts the statement back in the box with the problem selected, and Fix it puts it right where that is safe: see Check Design and Fixing Problems.
Each command is undone with Edit › Undo (Ctrl+Z), in one step, however many points, variables and elements it made; so are several statements run together, or a file run with ….
What undo steps are called
Every step on the undo history has a name that says what it does, in the app's language. Edit › Undo and Edit › Redo say which step they take back or do again (Undo Fold angle = 120°; just Undo when there is none), as do their tips and the drawing's right-click menu's, and the Interactive window says it as it is undone (Undo: Variable TUCK = 40) or redone. For example:
| What you did | The step is called |
|---|---|
| A variable set (in the Variables panel, the 3D page's Variables panel or typed here) | Variable TUCK = 40 |
| A setting of the 3D page's Scene panel changed | Scene: Rows = 5 |
| A panel folded by hand | Fold angle = 120° |
| Creases moved on the timeline | Fold steps (timeline) |
| The Boolean tool applied | Boolean (Subtract) |
| A product's pocket cut | Product pocket |
| A shape drawn with a tool | the tool's name, as the Tool menu has it (Circle) |
| A menu command | the menu item, and what it was set to (Fold Order: Base First) |
Copy as Statement only puts text on the clipboard, so it isn't a step on the undo history.
A variable or point given a new value that would break the drawing (such as an arc whose ends would be the same point) is put back as it was, with the reason shown in red, just as in the Variables and Points panels.
To zoom to the whole drawing after every command, set the system variable #ZA to TRUE (#ZA=TRUE).
How commands are written
KEYWORD argument,argument,…
- Keywords and names are not case sensitive:
line p0,p1isLINE P0,P1. - Points are named
Pand their number:P0,P12. In a new drawing P0 to P3 are the corners of the box,L(500) across andW(400) up. Make a new point with an assignment:P4=[250,200]. - Elements are named
@and their id:@1. A command that adds an element can be given one,LINE @1,P0,P1, so later commands can name it. - Lists of points are in square brackets:
[P1,P4,P5], or[P1..P5]for P1 to P5. - Numbers and sizes can mostly be any expression: a variable,
L/2,DISTANCE(P0,P1)… Elements and sizes are defined from points and variables, never fixed in space, so they follow when those change. - Strings are in double quotes:
"Lid". - Yes or no is
TRUEorFALSE.
What every element command shares, its id, layer, and the BRIDGES, TOOL, LINEWIDTH, HIDDEN and NOPLOT that can follow it, is in Element settings; the settings of dimensions are in Dimension settings.
Commands
Values
| Command | Does |
|---|---|
| name=expression | Give a variable or point a value. |
| expression | Show an expression's value. |
| RENAME | Rename a variable. |
| LABEL | Describe a variable. |
| Evaluate expressions. | |
| DESCRIBE | Show how elements, points and variables are defined. |
| DEPENDS | Show what something depends on, as a Mermaid graph. |
| SELECT | A variable chosen from named choices (a material and its thickness), others going with it. |
Lines, arcs and curves
| Command | Does |
|---|---|
| LINE | A straight line. |
| PARALLEL | A line parallel to two points, a distance away. |
| ARC | An arc round a centre. |
| ARC3 | An arc through three points. |
| BULGE | An arc that turns through an angle. |
| CIRCLE | A circle. |
| ELLIPSE | An ellipse. |
| ELLIPTICALARC | Part of an ellipse. |
| ELLIPTICALARC3 | An elliptical arc through three points. |
| BEZIER | A cubic Bézier curve. |
| QUADRATICBEZIER | A quadratic Bézier curve. |
| POLYLINE | Lines and arcs through a list of points. |
| SPLINE | Elements joined end to end. |
| CUBICSPLINE | The smoothest curve through points. |
| CATMULLROM | A smooth curve through points, shaped locally. |
| HERMITE | A curve through points with given tangents. |
| BSPLINE | A curve pulled towards control points. |
| NURBS | A NURBS curve. |
| PIECE | Part of another element. |
| OFFSET | A parallel copy of an element. |
Points, text, images and parts
| Command | Does |
|---|---|
| POINT | A point element, such as a drill hole. |
| TEXT | Text. |
| RASTERIMAGE | A picture on four points. |
| BARCODE | A barcode or QR code on four points. |
| BRAILLE | Braille in a box on four points, at Marburg Medium or ADA sizes. |
| VECTORIMAGE | A drawing within the drawing. |
| PART | A part (or a page) placed by name, its variables scoped. |
| PARTDEF | A drawing kept in the part library, by name. |
| SWITCHPART | One of several parts, picked by a variable. |
| NEST | A part laid out on a sheet as many times as fit. |
| IMPORT | Read a file and place it as a part or picture. |
| MERGE | Merge another drawing file into this one (File › Import › Merge Drawing…). |
| CALLOUT | Text in a box, with a leader. |
| MAGNIFIER | A magnifying glass: part of the drawing shown larger in a callout. |
| SHEET | A drawing sheet: a border showing a page of the drawing in its viewport. |
| VIEWPORT | A border's view area, where a sheet shows a page. |
| MATE | Where a folded part meets another: a lid on its box, a drawer in its sleeve. |
| GROUND | The panel a folded shape stands on: a carton on its bottom, a display on its foot. |
| CURVEDBEND | A panel bent round along its length: its score lines, and its curve in 3D. |
| FILL | Hatch lines, a colour or a gradient filling an area. |
| BOOLEAN | Closed shapes united, intersected, subtracted, exclusive or split; follows them. |
Dimensions
| Command | Does |
|---|---|
| DIMHORIZONTAL | Distance across. |
| DIMVERTICAL | Distance up. |
| DIMALIGNED | Straight distance. |
| DIMPERPENDICULAR | Distance from a point to a line. |
| DIMRADIUS | Radius. |
| DIMDIAMETER | Diameter. |
| DIMORDINATE | X or Y from an origin. |
| DIMANGULAR | Angle. |
Editing
| Command | Does |
|---|---|
| TRANSFORM | Move points by a transformation. |
| JOIN | Join elements end to end. |
| EXPLODE | Break elements into their parts. |
| INTERSECT | Split or trim elements where they cross. |
| SPLIT | Split an element at fractions of its length. |
| SPLITALONG | Split an element at distances along it. |
| FILLET | Round a corner. |
| CHAMFER | Cut a corner, two distances. |
| CHAMFEREQUAL | Cut a corner, one distance. |
| CHAMFERDISTANCEANGLE | Cut a corner, a distance and an angle. |
The drawing
| Command | Does |
|---|---|
| LAYERTABLE | A standard set of layers. |
| LAYER | Add or change a layer. |
| NOTE | Keep a note with the drawing. |
| CLASSIFY | Say what the drawing is: its category, style, tags … |
| ZOOM | Zoom the drawing. |
| PAGE | Work on a page (made if new), or delete or rename one. |
| CLEAR | Empty the drawing back to a new one. |
Loops, choices and functions
Statements that make geometry a command on its own can't, and stay parametric: see Blocks and control flow.
| Statement | Does |
|---|---|
| FOR | A block for each of a run of numbers. |
| FOREACH | A block for each of some points or values. |
| WHILE | A block again and again, while something is true. |
| IF | A block, or another: the first whose condition is true. |
| FUNCTION | A function of your own. |
| FUNCTION … JAVASCRIPT | A function of your own, written in JavaScript. |
| CALL | A function's geometry drawn. |
See also: Expressions, Tools.