Skip to main content

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​

Task accepted

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)

FieldTypeRequiredDescription
stepFileIdstringyesID 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.
fileUnitmm | cm | m | innoA unit of length: 'mm' (millimetres), 'cm' (centimetres), 'm' (metres) or 'in' (inches).
planobjectnoWhat 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.sheetobjectnoThe sheet a drawing is laid out on.
plan.sheet.sizestring | objectnoA standard sheet by name, or a custom one by its width and height in millimetres. A3 when left out.
plan.sheet.orientationlandscape | portraitnoLandscape when left out. Not given with a custom size, which is drawn as its width and height say.
plan.sheet.projectionfirst-angle | third-anglenoFirst-angle on ISO and custom sheets, third-angle on ANSI sheets, unless given.
plan.sheet.scalestring | objectnoThe 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.unitsmm | innoThe 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.decimalsintegernoThe 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.frontstring | objectnoWhat 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.partsstring | arraynoThe 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.viewsarray of objectnoThe 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[].namefront | top | bottom | left | right | back | isometricnoA named view of the front frame. Give one of name, frame and saved.
plan.views[].frameobjectnoA 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.originarray of objectnoA point of the view's plane; the origin of the model's space when left out.
plan.views[].frame.normalarray of objectyesThe 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.directionarray of objectyesWhat 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[].savedstringnoA 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[].hiddenLinesbooleannoWhether hidden edges are drawn, dashed. True unless the view is the isometric one.
plan.views[].smoothEdgesbooleannoWhether 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[].scaleobjectnoA drawing scale, numerator to denominator: 1 to 50 is { numerator: 1, denominator: 50 }. Between 1:1000 and 100:1.
plan.views[].scale.numeratornumberyes
plan.views[].scale.denominatornumberyes
plan.views[].captionstringnoA text under the view.
plan.sectionsarray of objectno
plan.sections[].labelstringyesThe section's letter, as in SECTION A-A. No two sections share one.
plan.sections[].frameobjectyesA 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.originarray of objectnoA point of the view's plane; the origin of the model's space when left out.
plan.sections[].frame.normalarray of objectyesThe 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.directionarray of objectyesWhat 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[].shownOnintegernoThe index of the view that carries the cutting-plane line. 0 when left out.
plan.sections[].hatchboolean | objectnoFalse for no hatch, true or left out for the default one.
plan.sections[].scaleobjectnoA drawing scale, numerator to denominator: 1 to 50 is { numerator: 1, denominator: 50 }. Between 1:1000 and 100:1.
plan.sections[].scale.numeratornumberyes
plan.sections[].scale.denominatornumberyes
plan.linesobjectnoHow 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.methodauto | exact | sight | meshno
plan.titleBlockboolean | objectnoFalse for a sheet without a title block; true, or left out, for one with empty fields.
plan.revisionsarray of objectno
plan.revisions[].markstringno
plan.revisions[].descriptionstringno
plan.revisions[].datestringno
plan.revisions[].bystringno
plan.dimensionsboolean | string | stringno'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.holesboolean | stringno'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.holeTableboolean | objectnoTrue, 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.flatboolean | string | objectnoTrue 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.annotationsboolean | objectnoTrue 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.sharedobjectnoWhat 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.viewsarray of objectnoThe 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[].namefront | top | bottom | left | right | back | isometricnoA named view of the front frame. Give one of name, frame and saved.
plan.shared.views[].frameobjectnoA 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[].savedstringnoA 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[].hiddenLinesbooleannoWhether hidden edges are drawn, dashed. True unless the view is the isometric one.
plan.shared.views[].smoothEdgesbooleannoWhether 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[].scaleobjectnoA drawing scale, numerator to denominator: 1 to 50 is { numerator: 1, denominator: 50 }. Between 1:1000 and 100:1.
plan.shared.views[].captionstringnoA text under the view.
plan.shared.marksarray of objectno
plan.shared.marks[].viewintegeryesThe index of the sheet's view it stands around.
plan.shared.marks[].calloutstringnoA 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[].balloonstringnoA balloon's text, a hole tag such as A12 included. Give a callout or a balloon.
plan.shared.marks[].atarray of objectyesThe point the leader points at, in the model's space.
plan.shared.marks[].centrearray of objectnoA 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.elsewherearray of objectno
plan.shared.elsewhere[].viewintegeryesThe index of the sheet's view it stands around.
plan.shared.elsewhere[].calloutstringnoA radius callout's text. Give a callout or a balloon.
plan.shared.elsewhere[].balloonstringnoA balloon's text, a hole tag included. Give a callout or a balloon.
plan.shared.notesbooleannoTrue 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.partsListboolean | objectnoTrue 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.balloonsboolean | objectnoWith 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.sheetsarray | objectnoSeveral 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.
planFileIdstringnoID 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'.
modelFromTaskstringnoThe 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​

StatusDescription
202Task accepted
400Validation error
403Insufficient scope
500Server 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.