Notes¶
Notes on the technical drawings contains special conventions and symbols used on the drawing. This information is provided to make sure the drawing is correctly understood by the reader. Notes are specified either on the sheet directly or close to the views, sometimes notes are associated with a leader pointing to the specific feature of the component.
Canvas Notes¶
Canvas notes are often termed as 'General Notes'. These notes are specified on the empty spaces of the drawing sheet. Werk24 interprets objects like material, general tolerances, etc from the text. For text that is not interpreted Werk24 returns canvas notes as free text.
Sectional Notes¶
Sectional notes are specified close to the views on the drawing. These notes provide information related to a particular section on the drawing. Werk24 does not return sectional notes at the moment. We are working actively on implementing sectional notes.
Models¶
-
Requesting all Notes : W24AskNotes
-
Getting response as W24 Object: W24AskNotesResponse
-
Processing the Notes: W24Note
Extracted information can be accessed from the W24Note
Model.
W24Note¶
Notes object for Sectional and Canvas Notes.
Attributes: type (W24NoteType): Type of the note to differentiate between notes that are associated with the complete sectional and the canvas
text (str): Raw text that was read.
Properties¶
-
position
: Refer to #/definitions/W24BaseFeaturePosition. -
type
: Refer to #/definitions/W24NoteType. -
text
(string)
Definitions¶
-
W24BaseFeatureCoordinate
(object): Coordinate point
Attributes: x: x position normalized by the thumbnail's width
y: y position normalized by the thumbnail's height. -
x
(number) -
y
(number) -
W24BaseFeaturePosition
(object): Position of the Feature on the individual thumbnails normalized by the width and height of each thumbnail.
Each features position is indicated as a list of coordinates. If the list only has two elements, you are dealing with a line. If it has four or more, you are looking at a polygon
Attributes: page: Position of the Feature on the Page thumbnail
sheet: Position of the Feature on the Sheet thumbnail
sectional: Position of the Feature on the Sectional thumbnail. -
sheet
(array)- Items: Refer to #/definitions/W24BaseFeatureCoordinate.
-
canvas
(array)- Items: Refer to #/definitions/W24BaseFeatureCoordinate.
-
sectional
(array)- Items: Refer to #/definitions/W24BaseFeatureCoordinate.
-
W24NoteType
(string): Differentiation between Canvas and Sectional Notes.
Canvas Notes are sometimes referred to as "General Notes", they are associated with the canvas in general.
Sectional Notes are associated with a specific sectional, but not as part of a leader or call-out. (e.g., "VIEW A")
Sectional Call Outs are linked to the sectional through a leader symbol (e.g., "MARK HERE")
NOTE: please note that we are only returning the information that is not understood by the system through another way. Over time, number of sectional call outs will thus gradually reduce. Must be one of:['CANVAS NOTE', 'SECTIONAL NOTE', 'SECTIONAL_CALLOUT']
.
Requesting the Notes¶
from werk24 import Hook, W24AskNotes, W24AskNotesResponse
from werk24.models.techread import W24TechreadMessage
from werk24.utils import w24_read_sync
# define a function to read a file and return it as bytes
from . import get_drawing_bytes
def recv_notes(message: W24TechreadMessage) -> None:
""" print the Notes when we received them
"""
if message.is_successful:
# print the response
print(message.payload_dict)
# get the response as W24 object
response = W24AskNotesResponse.parse_obj(message.payload_dict)
else:
print("Exceptions occurred: {message.exceptions}")
if __name__ == "__main__":
# get your drawing bytes from a file or buffer
drawing_bytes = get_drawing_bytes()
# define what information you want to receive from the API
# and what shall be done when the info is available.
hooks = [Hook(ask=W24AskNotes(), function=recv_notes)]
# submit the request to the Werk24 API
w24_read_sync(drawing_bytes, hooks)
Example Response¶
{
"notes": [
{
"position": {
"sheet": [
{
"x": 0.8428571428571429,
"y": 0.6373033707865169
},
{
"x": 0.625974025974026,
"y": 0.6373033707865169
},
{
"x": 0.625974025974026,
"y": 0.6278651685393258
},
{
"x": 0.8428571428571429,
"y": 0.6278651685393258
}
],
"canvas": [],
"sectional": []
},
"type": "CANVAS NOTE",
"text": "1. Material: Stainless Steel "
}
]
}