Drawing - read a model without drawing it
POST/api/v1/cad/pro/drawing/inspect
Reads the model of an uploaded STEP file as a drawing would, without drawing: how many parts it holds and its size, the first sheet's plan with every setting resolved, whether its views fit and the layout they take, the scale each standard sheet would allow, sections the model could be cut by, the views the file saved, every part with its name, and every sheet of the plan written out. The set's plan, edited or as it is, is ready to send to POST /api/v1/cad/pro/drawing/draw. Requires the 'cad' API key scope. Returns 202 with a task ID; the DrawingInspection is delivered as the metadata result.
Request
Responses
- 202
- 400
- 403
- 500
Task accepted
Validation error
Insufficient scope
Server error
Reference
POST /api/v1/cad/pro/drawing/inspect
Reads the model of an uploaded STEP file as a drawing would, without drawing: how many parts it holds and its size, the first sheet's plan with every setting resolved, whether its views fit and the layout they take, the scale each standard sheet would allow, sections the model could be cut by, the views the file saved, every part with its name, and every sheet of the plan written out. The set's plan, edited or as it is, is ready to send to POST /api/v1/cad/pro/drawing/draw. Requires the 'cad' API key scope. Returns 202 with a task ID; the DrawingInspection is delivered as the metadata result.
Request body
Content type: application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
stepFileId | string | yes | ID of the previously uploaded STEP file (.step, .stp or gzip-compressed .stpz), at most 200 MB. Every placed part of the file is a part of the drawing, numbered from 0 in the order the file's structure gives them. |
fileUnit | mm | cm | m | in | no | A unit of length: 'mm' (millimetres), 'cm' (centimetres), 'm' (metres) or 'in' (inches). |
plan | object | no | What to draw: one sheet, or a set of sheets. Every setting has a default, so an empty plan draws a default sheet; the inspect route returns the plan with every setting spelled out and every sheet of a set written out, ready to edit and send to the draw route. A request body takes at most 128 KB, so a set written out past that, of a model with hundreds of sheets or thousands of parts beneath every level, is uploaded as a JSON file and named in 'planFileId', or sent as its rule. |
plan.sheet | object | no | The sheet a drawing is laid out on. |
plan.sheet.size | string | object | no | A standard sheet by name, or a custom one by its width and height in millimetres. A3 when left out. |
plan.sheet.orientation | landscape | portrait | no | Landscape when left out. Not given with a custom size, which is drawn as its width and height say. |
plan.sheet.projection | first-angle | third-angle | no | First-angle on ISO and custom sheets, third-angle on ANSI sheets, unless given. |
plan.sheet.scale | string | object | no | The sheet's scale. 'fill', the default, takes the largest scale at which every view fits from the scales ISO 5455 recommends and those GOST 2.302 adds (1:2.5, 1:4, 1:15, 1:25, 1:40, 1:75 and the like); 'auto' keeps to the preferred 1, 2 and 5 steps. A fixed scale that does not fit is refused with the scale and the sheet that would. |
plan.units | mm | in | no | The unit every length the sheet prints is written in: 'mm', millimetres, or 'in', decimal inches. It covers the overall sizes, ordinates, diameters, radius callouts, the hole table, the bend table's radius, the flat pattern's sizes and a custom sheet's size in the title block, whose UNITS cell says MM or IN; angles stay in degrees. In inches an automatic scale comes from the inch series (1:2, 1:4, 1:8, 1:10, 1:20 and so on), and the DXF and SVG are written in inches; the PDF keeps the paper's millimetres, and the geometry, the plan's lengths and every number of the report stay in millimetres. Left out, the STEP file's own unit decides: a file in inches, by its header or by 'fileUnit', is drawn in inches, any other in millimetres. |
plan.decimals | integer | no | The places a printed length is written to: in millimetres at most that many, 0 to 4, idle zeros and the point dropped (12.5, 12); in inches exactly that many, 1 to 4, with no zero before the point (.250, 1.500). 2 in millimetres and 3 in inches when left out. A plan that names no units and 0 places is refused when the file proves to be in inches. |
plan.front | string | object | no | What the view names mean: 'front' looks along this frame and the other names turn with it. Left out, a sheet is drawn from its part's own front, square to the part's own faces (its plain faces and the axes of its round ones, the space's axes when the part is square to them), looking along the axis it shows most of with its long side across: a plate looks along its thickness and a turned part across its axis. The resolved plan writes that front into the sheet. A sheet of a list keeps the plan's front, or the space's axes, unless it says turned. 'annotations' asks for the front most of the sheet's drawn annotations read upright from, when it draws them; annotations never choose or tilt a front otherwise. |
plan.parts | string | array | no | The parts to draw by number, each once, or 'all'. Left out or 'all', every part that holds a face when any part does: loose curves beside solids, such as the curves an AP203 file draws its notes with, are left out and counted in the report's model.faceless. |
plan.views | array of object | no | The views, the first being the base the others line up with; views a plan states are kept as stated. Left out, a sheet the plan or a rule makes gets the views that describe its part: a plate its front and one edge view, a turned part its side and its end, any other part front, top and right, each with the isometric, which may take a smaller scale of its own. A view that does not fit beside them at their scale goes to a continuation sheet, and when the principal views' annotation letters would be under 2.5 mm together, each principal view whose letters would read on a sheet of its own gets one (the front stays); each continuation sheet says why in its pagination. A sheet of a list that states no views gets front, top, right and isometric. Empty only beside a flat pattern, for a sheet of the flat pattern alone, or beside shared notes, for a sheet of the general notes alone. |
plan.views[].name | front | top | bottom | left | right | back | isometric | no | A named view of the front frame. Give one of name, frame and saved. |
plan.views[].frame | object | no | A view frame in the model's space, which is Y-up as a STEP file is read: millimetres, an origin, a normal and a direction. |
plan.views[].frame.origin | array of object | no | A point of the view's plane; the origin of the model's space when left out. |
plan.views[].frame.normal | array of object | yes | The side the eye is on: the view looks back along it. For a section it is the side that is cut away. |
plan.views[].frame.direction | array of object | yes | What runs to the right in the view. It need not be of unit length nor exactly square to the normal, but it may not be parallel to it. |
plan.views[].saved | string | no | A view the STEP file saved (an AP242 model view), by its name: the sheet looks along it with its up upward, captioned with its name and without hidden lines unless told otherwise. A name the file does not hold refuses the sheet. Give one of name, frame and saved. |
plan.views[].hiddenLines | boolean | no | Whether hidden edges are drawn, dashed. True unless the view is the isometric one. |
plan.views[].smoothEdges | boolean | no | Whether edges where faces meet without a crease, such as the ends of a fillet, are drawn as thin lines. True when left out; seams of round faces are never drawn. |
plan.views[].scale | object | no | A drawing scale, numerator to denominator: 1 to 50 is { numerator: 1, denominator: 50 }. Between 1:1000 and 100:1. |
plan.views[].scale.numerator | number | yes | |
plan.views[].scale.denominator | number | yes | |
plan.views[].caption | string | no | A text under the view. |
plan.sections | array of object | no | |
plan.sections[].label | string | yes | The section's letter, as in SECTION A-A. No two sections share one. |
plan.sections[].frame | object | yes | A view frame in the model's space, which is Y-up as a STEP file is read: millimetres, an origin, a normal and a direction. |
plan.sections[].frame.origin | array of object | no | A point of the view's plane; the origin of the model's space when left out. |
plan.sections[].frame.normal | array of object | yes | The side the eye is on: the view looks back along it. For a section it is the side that is cut away. |
plan.sections[].frame.direction | array of object | yes | What runs to the right in the view. It need not be of unit length nor exactly square to the normal, but it may not be parallel to it. |
plan.sections[].shownOn | integer | no | The index of the view that carries the cutting-plane line. 0 when left out. |
plan.sections[].hatch | boolean | object | no | False for no hatch, true or left out for the default one. |
plan.sections[].scale | object | no | A drawing scale, numerator to denominator: 1 to 50 is { numerator: 1, denominator: 50 }. Between 1:1000 and 100:1. |
plan.sections[].scale.numerator | number | yes | |
plan.sections[].scale.denominator | number | yes | |
plan.lines | object | no | How hidden lines are found. 'auto', the default, keeps the exact method to a budget: it draws the sheet exactly when the exact method is predicted to take 10 s or less for all its views together on a native build of the kernel (about 12 s on CAD Cloud, whose kernel takes 1.2 times as long), and by sight otherwise. The prediction weighs the faces by what they cost the exact method: a freeform face (a B-spline or Bezier surface, an offset of one, or a surface turned from a B-spline or Bezier curve) weighs as 160 plain faces, more when its normals turn round more than once, as on a coil spring, and a torus up to as much as a freeform face. The report's run.chosenBy says 'budget' or 'within', and run.exactEstimate gives the predicted seconds on CAD Cloud, about, whenever a view was drawn by sight. On a sheet over the budget a view is drawn by sight even when a few faces cannot be meshed; they hide nothing, and a warning says so. 'exact' works from the geometry alone; 'sight' draws the model's own edges and decides what is hidden from a picture of its mesh, seconds where 'exact' takes minutes on a large assembly; 'mesh' draws the edges of a tessellation. |
plan.lines.method | auto | exact | sight | mesh | no | |
plan.titleBlock | boolean | object | no | False for a sheet without a title block; true, or left out, for one with empty fields. |
plan.revisions | array of object | no | |
plan.revisions[].mark | string | no | |
plan.revisions[].description | string | no | |
plan.revisions[].date | string | no | |
plan.revisions[].by | string | no | |
plan.dimensions | boolean | string | string | no | 'auto' sizes the first view's width and height and the one size each top, bottom, left or right view of it adds; on a sheet of one part it also sizes every distinct outside diameter once, in the first view that sees it from the side, and calls out every distinct radius of a round once, in the first view that sees it end-on. 'ordinate' gives the same, except that the first view is measured by ordinates from the lower left corner of the part's box, the corner the hole table measures from, to each hole centre it sees end-on and to the far sides. Left out, a plan without 'sheets', like a sheet a rule makes, gets 'auto', and a sheet given in a 'sheets' list draws none unless it or the plan asks for them. False draws none. |
plan.holes | boolean | string | no | 'auto' recognises the holes (through, blind, counterbored, countersunk), draws their centre marks and lines, tags those the first view sees end-on and lists them in a hole table. Left out, a plan without 'sheets', like a sheet a rule makes, gets 'auto' on a sheet of one part, and a sheet given in a 'sheets' list draws none unless it or the plan asks for them. False draws none. |
plan.holeTable | boolean | object | no | True, the default, lists the holes 'auto' tags in a hole table; a table too long for its sheet is left out with a warning, and a set continues it on sheets of its own instead. False leaves the table out and keeps the tags and centre marks. Given as rows, the sheet is a hole table alone and takes no views, sections, dimensions, holes, flat pattern, balloons, annotations or parts list. |
plan.flat | boolean | string | object | no | True adds a sheet-metal part's flat pattern as a view, with its bend lines and a bend table; 'auto' does so only when the part unfolds cleanly with a bend that folds: a part whose unfold is not clean, such as a casting, gets none, and a warning says why. Only a sheet of one part has one. With a flat pattern, views may be empty: the sheet is the flat pattern alone. Left out, a plan without 'sheets', like a sheet a rule makes, gets 'auto' on a sheet of one part, and a sheet given in a 'sheets' list has none unless it or the plan asks for one. False leaves it out. |
plan.annotations | boolean | object | no | True draws the dimensions, tolerances, datums and notes the STEP file stores (AP242), each on a view that faces the plane it was made in, adding views for planes none of the plan's views faces, and turns a line of letters that would read from the top or the left to read from the bottom or the right. Only a sheet of every part draws them: the model's own where they stand and each product's once, at its first instance. Given as an object, 'product' and 'instance' name one product's annotations, drawn where that instance stands whatever parts the sheet shows (a set made by a rule names them so on the sheet of each product that has annotations), and 'addViews' and 'notes' false leave the annotations no view faces and the general notes to another sheet of the set. Annotations never turn the front unless 'front' is 'annotations'. False when left out. |
plan.shared | object | no | What a sheet shares with the other sheets of its part. A resolved set writes it into the pages of a sheet it paginated, a continuation sheet for each view that did not fit or would not read beside the others, for the callouts and balloons the first sheet had no room for, and for general notes, so the set, sent back, draws the same sheets. Not given on a parts list or a hole table alone. |
plan.shared.views | array of object | no | The views the pages of one sheet share, in their order: the automatic sizes, diameters and radius callouts of dimensions are decided over all of them, as one sheet of every view would give them, and each page draws those that fall on its own views (matched by frame), so no size is given on two pages. |
plan.shared.views[].name | front | top | bottom | left | right | back | isometric | no | A named view of the front frame. Give one of name, frame and saved. |
plan.shared.views[].frame | object | no | A view frame in the model's space, which is Y-up as a STEP file is read: millimetres, an origin, a normal and a direction. |
plan.shared.views[].saved | string | no | A view the STEP file saved (an AP242 model view), by its name: the sheet looks along it with its up upward, captioned with its name and without hidden lines unless told otherwise. A name the file does not hold refuses the sheet. Give one of name, frame and saved. |
plan.shared.views[].hiddenLines | boolean | no | Whether hidden edges are drawn, dashed. True unless the view is the isometric one. |
plan.shared.views[].smoothEdges | boolean | no | Whether edges where faces meet without a crease, such as the ends of a fillet, are drawn as thin lines. True when left out; seams of round faces are never drawn. |
plan.shared.views[].scale | object | no | A drawing scale, numerator to denominator: 1 to 50 is { numerator: 1, denominator: 50 }. Between 1:1000 and 100:1. |
plan.shared.views[].caption | string | no | A text under the view. |
plan.shared.marks | array of object | no | |
plan.shared.marks[].view | integer | yes | The index of the sheet's view it stands around. |
plan.shared.marks[].callout | string | no | A radius callout's text, such as 4X R10, or the X0 Y0 of a hole table's origin. Give a callout or a balloon. |
plan.shared.marks[].balloon | string | no | A balloon's text, a hole tag such as A12 included. Give a callout or a balloon. |
plan.shared.marks[].at | array of object | yes | The point the leader points at, in the model's space. |
plan.shared.marks[].centre | array of object | no | A radius callout's arc centre in the model's space, which leads it along the arc's radius as on its first sheet. |
plan.shared.elsewhere | array of object | no | |
plan.shared.elsewhere[].view | integer | yes | The index of the sheet's view it stands around. |
plan.shared.elsewhere[].callout | string | no | A radius callout's text. Give a callout or a balloon. |
plan.shared.elsewhere[].balloon | string | no | A balloon's text, a hole tag included. Give a callout or a balloon. |
plan.shared.notes | boolean | no | True makes the sheet the general notes alone, laid over its whole frame, for notes the first sheet had no room for; its views are then an empty list. False when left out. |
plan.partsList | boolean | object | no | True gives every assembly's sheet a list of what goes directly into it (item, name, quantity, the sheet it is drawn on) and, when the list has at most 40 rows, balloons pointing at them; a list too long for the sheet takes sheets of its own after it. Not true with a hole table alone. A list given as rows is drawn on every sheet. False, the default, draws none. |
plan.balloons | boolean | object | no | With a parts list of true, false leaves its balloons out. Given as items, balloons around one view of every sheet, or around one section when the plan has no rule. |
plan.sheets | array | object | no | Several sheets: a list, each sheet stating what it changes of the plan (a sheet stating only parts is drawn with everything else as the plan says), or a rule that makes the list from the model's structure. One sheet of the plan when left out. The settings at the top of the plan are laid under every sheet. |
planFileId | string | no | ID of a previously uploaded JSON file holding the plan (named .json or of type application/json), at most 32 MB, in place of 'plan': for a set written out past the 128 KB a request body takes. It is held to the same rules as 'plan', and a refusal names the field inside the file. Not given with 'plan'. |
modelFromTask | string | no | The id of an earlier draw or inspection of this same uploaded file, read in the same 'fileUnit', whose model to take: the parts are taken from the model that task kept instead of being read from the file again, which on a large file is most of what an inspection or a sheet takes, and the sheets are the same, byte for byte. The task must be this account's, completed and not expired, started with an API key of the same storage as this request's, and have kept its model, which its report says under run.model.kept; a task that does not qualify refuses the request before it is queued, saying why, with the error's details naming the field 'modelFromTask'. Should the kept model turn out unusable once the task runs, the file is read instead and run.model.notReused says why. |
Responses
| Status | Description |
|---|---|
202 | Task accepted |
400 | Validation error |
403 | Insufficient scope |
500 | Server error |
Example request
curl -X POST "https://api.bitbybit.dev/api/v1/cad/pro/drawing/inspect" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'
Authentication: send your key in the x-api-key header. The full machine-readable specification is at openapi.json.