AskReferencePositions (Auxiliary)
Requires an AskFeatures or AskMetaData request
This is an auxiliary request that must be accompanied by an AskFeatures or AskMetaData request. It returns the positions of the elements those asks extracted in the same request. Asked on its own, there is nothing to position and you receive no reference positions.
Description
AskReferencePositions returns where each extracted element sits on the sheet. Every dimension, thread, bore, title-block entry and other element in an AskFeatures or AskMetaData response carries a reference_id; this ask returns a ReferencePosition for each of them: the same reference_id together with a Polygon outlining the element.
When to use
- Traceability and review UIs: highlight a dimension on the sheet when a user selects it in a table, or the other way round.
- Checking a result against the drawing: show a reviewer exactly which callout a value was read from.
Join the positions to the other responses by reference_id (together with the page, see Reference ID). Draw them on the image returned by AskSheetImages rather than on your original upload: Werk24 corrects the page rotation, and the coordinates refer to the corrected sheet.
How to read the response:
- You receive one response per page, carrying the positions of that page's elements.
coordinate_spacesays which space the coordinates are in. Positions are given inPIXEL_SPACE, pixel coordinates on the sheet.- A polygon can have as few as two points: a dimension, for example, is placed as the line it sits on.
- An element without a location on the sheet has a
polygonthat isnullor has no coordinates. Treat both as "not placed".
Example Usage
ResponseReferencePositions
Bases: Response
A class that represents an Response to a request for the position of a component in the drawing.
| PARAMETER | DESCRIPTION |
|---|---|
ask_version | TYPE: |
ask_type | TYPE: |
reference_positions | The positions of the component in the drawing. TYPE: |
Source code in werk24/models/v2/responses.py
Example Response
Here reference_id 0 is a dimension, placed as a line, and reference_id 1 is a title-block entry, placed as a rectangle.