Reports
A report counts and measures what is in a drawing: how many elements there are, how long the cuts and creases are layer by layer, the length of rule a die needs and what it might cost, the blank's size, a list of every element. File › Reports… lists the reports, asks for the one chosen's options, and shows what it finds. Copy puts it on the clipboard as text; Save… writes it as CSV, an Excel workbook (which Numbers and Google Sheets open too), an OpenDocument spreadsheet (LibreOffice's), a web page, a PDF (to print or send: laid out as the web page, its pictures drawn as they are, long tables carried onto more pages), a Word document (which Pages and Google Docs open too) or an OpenDocument text (LibreOffice's), both laid out as the PDF and still editable, Markdown (for a wiki or notes), JSON (the figures as they are, for other programs) or text. In the spreadsheets numbers stay numbers and the headings are bold.
Reports are written in JavaScript, so you can change the ones that come with the app or write your own: what to count, how to group it, the units and prices, the columns.
Declaring one
drawingReport({
name: "Cut and crease",
category: "Quantities",
description: "Total cut and crease length.",
options: { selectionOnly: { label: "Selected elements only", value: false } },
run(drawing, options) {
const elements = drawing.elements.filter(e => !options.selectionOnly || e.selected);
const length = layer => elements.filter(e => e.layer === layer).reduce((t, e) => t + e.length, 0);
return {
title: "Cut and crease",
summary: `${elements.length} elements`,
tables: [{
columns: ["Layer", { title: `Length (${drawing.units})`, decimals: 1 }],
rows: [["Cut", length(0)], ["Crease", length(1)]],
footer: ["Total", length(0) + length(1)]
}]
};
}
});
| Property | Meaning |
|---|---|
name, description |
As shown when choosing it. |
category |
Groups it in the list: Quantities › Element list. |
options |
Its options, asked for before it runs. |
run(drawing, options) |
Works out the report and returns it. |
drawing is the drawing as design rules see it: its name, units, extent and layers, and
each element exported with its id, kind, layer, length, area, ends, extent, bridges and tool, and whether it is
selected; the page worked on; the nests on every page, with their sheets, copies and wastage; and its
notes by name (drawing.notes["Customer"]). options holds the values chosen, by name. The drawing API's reading functions can be
used too (variable("L"), getPoint(4), evaluate("…")), and distanceBetween and crossings. A report can't
change the drawing.
For the trades' reports it also has drawing.panels (each closed outline on a cut layer that is a piece: its size as
the smallest rectangle round it, area, perimeter, holes, cut-outs and notches, the texts inside it, its grain and edge
banding, and its thickness and look as in 3D: its own RULE THICK and LOOK, else its layer's LAYER3D, else
null), drawing.welds (the welds numbered with the Weld Number tool) and
drawing.rollLayouts (each roll layout's drops, seams and cutting plan).
What it returns
| Property | Meaning |
|---|---|
title |
The report's title (its name if left out). |
summary |
A line of text, or an array of lines, shown above the tables. |
tables |
An array of tables (or just one). |
notes |
A line or lines shown below the tables. |
csvTable |
A table (its place from 0, or its heading) that alone is the CSV: its column titles and rows, no title, summary or notes, for a program to import. |
figures |
Pictures for the web page, under the tables: each { heading, svg }, an SVG drawn by the report (a cut plan, a weld map). Not in CSV or text. |
Each table has:
| Property | Meaning |
|---|---|
heading |
Shown above it (none if left out). |
columns |
Each column's title, or {title, decimals, align}: the decimal places its numbers are shown to, and "left" or "right". |
rows |
Each row: an array of cells, or an object of them by column title ({ Layer: "Cut", Length: 920 }). |
footer |
A row of totals, set off below the rows. |
Cells are numbers, text, or true/false (shown as Yes and No); null leaves a cell empty. Numbers are shown to the
column's decimals (whole numbers as they are, others to 2, if it doesn't say), and on the right. In CSV they are
written in full, for a spreadsheet to work with.
A report can also return just text: a string, or an array of lines.
Reports that come with the app
| Report | What it shows |
|---|---|
| Elements and lengths | How many elements and their total length, by layer, by kind, or both; the whole drawing or the selection. |
| Rule lengths and cost | Rule on each cutting and creasing layer, in metres (feet for inch drawings), less the bridges; a cost from a price per metre and a set-up cost. |
| Drawing summary | Its size and the area of its extent, how many elements and closed shapes, the layers used, the area the closed shapes enclose, and its notes. |
| Element list | Every element with its kind, layer, length and area: save it as CSV for a spreadsheet. |
| Laser job time and cost | How long a laser takes, layer by layer and in all: cut and score lengths at their speeds (a layer's own feed rate where it has one) and passes, engraving line by line across each engraved layer, the travel between cuts (nearest cut next) and a pause at each pierce; and the cost: machine time at a cost per minute, the material per m² (ft²), and a set-up cost, for a copy and for the copies wanted. See LightBurn. |
| Moulding order list | For each frame (the Mitre Frame tool's, or the library's Frame moulding cut list): the moulding's width and rebate, the outside, rebate (chop) and sight sizes; each piece's long point and its length along the rebate; the moulding to order, each side along the rebate and a moulding width for each mitre (the trade rule), with two saw cuts a piece and an offcut allowance, chopped to size or in whole lengths (pieces fitted into lengths longest first) and at a price per metre (foot); and the glazing, mount board and backing that fit, the rebate less a clearance all round. Save it as CSV, or as a web page to print. |
| Board cost and wastage quote | What a packaging run costs at each quantity asked for (1000, 2500, 5000 …): the sheets of board the nests take, with make-ready sheets and running spoilage, their area and wastage, the board's cost per m² (ft²) or per sheet, the die's rule by the metre (foot) and its fixed cost, make-ready and running per thousand sheets, printing (plates and each colour per thousand sheets) and gluing per thousand copies; the total, the price each and per thousand. With no nest, the board is worked out from each blank's extent. Last comes Price to the customer, with your Markup (%) added: the quantities and their prices, each and per thousand, a sheet to send. |
| Pack footprint | What a pack takes and leaves behind, for one pack and a run: the board its blank takes (its outline closed, else its rectangle) and weighs at your board weight; the empty space round the product inside it (the drawing's L × W × D and the product's size) against a limit, 50% by default as the EU packaging regulation (PPWR) asks of grouped, transport and e-commerce packs; the board's carbon at your board maker's figure; and the other materials its accessories add, to separate before the board is recycled. |
| Rule bending | The die's rules as a rule bender makes them: each length of rule (joined end to end where two of a kind meet), its type, length, bends (corners and arcs, by the angle they turn and their radii, where they are along it) and bridges; and the arcs too tight, straights too short, corners too sharp and bridges on bends for your bender. |
| Stone quote | A stone job's price: each piece (closed outlines on the Cut layer) with its size, area and area less its cut-outs; the finished edges by profile in metres (feet) — the lines on the Edge … layers the Edge Profile tool marks — at a price per metre for each profile; the cut-outs counted by kind (from a label inside each: Sink, Hob, Tap hole, Socket; else a small circle is a tap hole) at a price each; the slabs laid out (the Slab Photo tool's) with the pieces on each and its yield; the stone and fabrication by area (each piece's, less the cut-outs, or whole slabs) with waste, and fixed costs. Prices are typed as Name=price; Name=price. See Stone and Tile. |
| Steel cutting list | Each steel piece (as the DSTV NC export finds them: its mark, profile, grade and quantity from the classification) with its length, width and thickness, weight per metre, weight each and in all, a plate's area (less its holes) and the surface to paint; and the bill of materials by profile (plates by thickness) and grade: pieces, length, plate area and weight, and a cost at a price per kg. See Structural steel. |
| Bend table | Each bend of a sheet-metal flat blank in a suggested bending order: its way (up or down), angle, inside radius, bend allowance and deduction, the flange either side (to the virtual sharp) and the flat it is made from, its length and where it starts. See Sheet metal. |
| Duct fitting schedule | Each HVAC fitting (a page each) with its size, the galvanised steel gauge its size and pressure class call for (½, 1 or 2 in. w.g.), its developed area and weight at that gauge, the weight at the drawing's own thickness and a check that it isn't thinner, and a cost at a price per kg. See HVAC. |
| Weld map | The welds numbered with the Weld Number tool, in order: each one's number, joint, type, size, WPS (or one given for all) and shop or field, with columns for the welder, date and inspection (NDT) to fill in; saved as a web page, a picture of the drawing with the weld numbers. Save it as CSV for a weld log. |
| Glass order list | Each pane (a closed outline on a cut layer) as a glass processor orders it: width × height (the rectangle round a turned or shaped pane), thickness (the drawing's T, or as given), glass, shape (rectangle, notched, or shaped: send a template), edgework, holes by diameter, notches and cut-outs by size, toughening or lamination (EN 12150, EN 14179, EN 14449, EN 1863), quantity (a pane's label Door (2) makes two), area and edge length; holes and cut-outs nearer the edge than twice the thickness are flagged. Tick CSV: the order list only to save just the panes' table as CSV for an order import. |
| Panel cut list | Each part (a closed outline on a cut layer, named by the text in it: Rails (2) makes two) for a panel saw optimiser: part, material, thickness (each part's own 3D thickness, RULE THICK, else its layer's LAYER3D THICK, else the board's: so a 6 mm back lists as 6 mm; with parts of several thicknesses, the optimisers' material names the thickness), length × width with the length along the grain (a line on a Grain layer across a part turns it), grain, quantity, and edge banding on each edge (lines on a layer whose name has band or edging in it, along the part's sides: L1, L2 the long edges, W1, W2 the short ones). A part's outline is its finished size: Sizes lists the cut sizes (Cut, the default: the outline less the band's thickness on each banded edge, the band layer's THICK, else 1 mm, as in 3D) or the outline's (Finished, for an optimiser that takes the banding off itself). Columns for: General; MaxCut (Type, Name, Material, Length, Width, Quantity, Can Rotate, Edging Length 1 and 2, Edging Width 1 and 2, Notes — map them in MaxCut's Import CSV); OptiCut (its spreadsheet columns Material, Quantity, Reference, Height, Width, Grain 0/1, then Top, Bottom, Right and Left Edge 0/1); CutRite (Code, Description, Material, Length, Width, Quantity, Grain, Edge 1–4, for a Cut Rite ASCII part-list import map). Saved as CSV, just the parts' table. |
| Carpet roll cut list | From each roll layout (or a design's ROLLPLAN): each drop's length on the floor and as cut from the roll (with the trim at both ends, rounded up to the pattern repeat if there is one), the roll length to order, the floor and roll areas, the waste, the seams and their length, and a price per m² (ft²) and per metre of seam; saved as a web page, the seam diagram (the floor, the drops numbered, the seams, the pile direction) and the cut plan (the drops along the roll) to print or save as PDF from the browser. |
| Foam and gasket material quote | What the pieces cost at each quantity: the sheets they take (from the nests, or each piece's rectangle and a margin, on a sheet size given), the waste, the material priced per sheet, per m² (ft²) or per m³ of block (at the sheet's thickness), the layers a deep piece is built of, the cutting time (the cut length at the cutting speed and a pause at each pierce) at the machine's rate, and a set-up cost; the total and the price each. |
| Nests and wastage | Each nest's sheet, copies on a sheet, the sheets the copies wanted take, the copies made and spare, and the wastage: a sheet's, and the run's with the spare copies counted as waste; the areas in m² (ft² for inch drawings). Worked out for each nest's own number of copies, or for a number given; this page or every page; and what the sheets cost, at a price per sheet. |
| Accessories and fitments | The accessories placed on the design (handles, hang tabs, window film, cords, hangers, stand-offs, snaps …) added up by item, for a copy and for a run of copies: each, by the metre or by the m², at the shared price list's prices (File › Extensions › Accessory Prices) or each part's own; and where each one is. The board, foam and gasket quotes, the laser job and the moulding order list add the accessories to their costs too. |
They are in reports.js in the app's Extensions folder, with the helpers they share (sum, groupBy); the weld
map, glass order list, panel cut list, carpet roll cut list and foam and gasket quote are in tradereports.js. Copy the file
to your own folder (File › Extensions › Open Extensions Folder) to change them: a price in your currency, the
layers your dies use, the columns your estimator wants.
In your language
The reports that come with the app are shown in the language the app is in (English, Spanish or Simplified Chinese): their names, categories, descriptions and options in the Reports dialog and in Make It, and what they write (titles, headings, columns, summaries and notes), with numbers written your way (a decimal comma in Spanish). What other programs import stays in English: the panel cut list's MaxCut, OptiCut and CutRite columns, and the glass order list when CSV: the order list only is ticked. What comes from your drawing (layer names, part names, accessory items) is shown as it is.
A report of your own can do the same:
tr("English text", …)gives a text in the user's language, its{0},{1}… filled from the values after it; a number's placeholder can say how to write it:{0:F2}for two decimals.fmt(number, decimals)writes a number the user's way.- The translations are in a
stringsfolder beside the script:es.jsonandzh-Hans.json, each the English texts and their translations. What the report declares (its name, category, description, options and their choices) is translated from them too; the choices' values thatrunis given stay as declared. A text with no translation is shown in English, and your folder's translations stand over the app's. - A word that translates differently in two places carries its context before a bar:
tr("weld|Socket")shows Socket in English.
const count = (n, one, many) => tr(n === 1 ? one : many, n);
summary: tr("{0}, {1:F2} m in all.", count(rules.length, "{0} rule", "{0} rules"), total)
Notes
- A report that goes wrong says so, with the file and line.
print(…)andconsole.log(…)show values in the Interactive window while you write one.
To email a report instead of saving it, use File › Send by Email › Report…, and choose Save… in the report: see Emailing exports. See also: Extensions, Design rules, Drawing API.