PMI Extract¶
The Product Manufacturing Information (PMI) describes all the information required for production, that is NOT covered in a normal 3D Model. Knowledge of this information can be important in a number of situations, ranging from price calculation, over feasibility checks to data analytics tasks. WERK24 makes the information stored in Technical Drawings available to you with a simple api call.
Models¶
The data models are defined in the following models:
- Requesting the PMIExtract:W24AskProductPMIExtract
- Receiving the PMIExtract as W24 Object: W24AskProductPMIExtractResponse
Requesting the PMIExtract¶
from werk24 import Hook, W24AskProductPMIExtract
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 request_pmi_extract(drawing_bytes: bytes) -> None:
""" Request PMI Information """
w24_read_sync(
drawing_bytes,
[Hook(ask=W24AskProductPMIExtract(), function=recv_pmi_extract)]
)
def recv_pmi_extract(message: W24TechreadMessage) -> None:
""" Called when the information is available """
...
if __name__ == "__main__":
request_pmi_extract(get_drawing_bytes())
Response Model¶
The payload field of the W24TechreadMessage contains a W24AskProductResponse object with all the details you are looking for.
Field | Type | Description |
---|---|---|
variant_id | UUID4 | Unique identifier of the Variant. Currently WERK24 will only return one Variant per Drawing. This value prepares the API to support Drawings with variant tables (i.e., parts that have a similar geometry, but differ in one or more dimensions or in their material). |
material | Optional[W24Material] | Material that was detected on the technical drawing. If no material was detected, this is set to None. |
general_tolerances | Optional[W24GeneralTolerances] | General tolerances detected on the drawing. This will automatically translate the general tolerances detected on the canvas notes to an ISO-2768 class. None if no general tolerances are detected. |
measures | List[W24Measure] | List of the available measures on the drawing. Note: in the PMIExtract, the position is not be returned. |
gdts | List[W24GDT] | List of the detected GD&Ts. Note: in the PMIExtract, the position is not be returned. |
radii | List[W24Radius] | List of the detected Radii. Note: in the PMIExtract, the position is not be returned. |
roughnesses | List[W24Roughness] | List of the detected Surface Roughnesses. Note: in the PMIExtract, the position is not be returned. |
general_roughnesses | List[W24GeneralRoughness] | List of the detected General Surface Roughnesses. Note: in the PMIExtract, the position is not be returned. |
reference_roughnesses | List[W24RoughnessReference] | List of the detected Surface Roughnesses. Note: in the PMIExtract, the position is not be returned. |
Response Language¶
Werk24 returns all its responses in American English. The main reason is to avoid confusions between variations in spellings for different versions of English language in various countries. American English for spelling and grammar provides consistency and clarity in communication, reducing potential confusion and language barriers, as it is widely understood globally.
Example
Werk24 consistently tries to use American versions of spellings.
For example:
✓ Mold
✗ Mould
Example Response¶
{
"variant_id": "d6e17a13-cf90-46b4-b5d7-12f010877ff9",
"material": null,
"general_tolerances": null,
"measures": [
{
"position": null,
"measure_id": "491d550c-888e-4009-938b-f0362887d86c",
"label": {
"blurb": "\u00d826.8 +0.1/-0.1",
"quantity": 1,
"size": {
"blurb": "\u00d826.8",
"size_type": "DIAMETER",
"nominal_size": 26.8
},
"size_tolerance": {
"toleration_type": "OFF_SIZE",
"blurb": "\u00b10.1",
"deviation_lower": -0.1,
"deviation_upper": 0.1,
"tolerance_grade": {
"grade": 11.0,
"warning": null
}
},
"unit": "MILLIMETER",
"thread": null,
"chamfer": null,
"depth": null,
"test_dimension": null
},
"warnings": [],
"confidence": 0.9936011109280891
},
{
"position": null,
"measure_id": "2ab45e07-836a-4a96-9d9a-6cf065ae947e",
"label": {
"blurb": "\u00d821.6 +0.1/-0.1",
"quantity": 1,
"size": {
"blurb": "\u00d821.6",
"size_type": "DIAMETER",
"nominal_size": 21.6
},
"size_tolerance": {
"toleration_type": "OFF_SIZE",
"blurb": "\u00b10.1",
"deviation_lower": -0.1,
"deviation_upper": 0.1,
"tolerance_grade": {
"grade": 11.0,
"warning": null
}
},
"unit": "MILLIMETER",
"thread": null,
"chamfer": null,
"depth": null,
"test_dimension": null
},
"warnings": [],
"confidence": 0.9931795880591704
},
{
"position": null,
"measure_id": "aa002ac4-53a3-4bb3-a5f6-3639d7d2878c",
"label": {
"blurb": "\u00d821 h7 0/-0.021",
"quantity": 1,
"size": {
"blurb": "\u00d821",
"size_type": "DIAMETER",
"nominal_size": 21
},
"size_tolerance": {
"toleration_type": "FIT_SIZE_ISO",
"blurb": "h7",
"deviation_lower": -0.021,
"deviation_upper": 0.0,
"fundamental_deviation": "h",
"tolerance_grade": {
"grade": 7.0,
"warning": null
}
},
"unit": "MILLIMETER",
"thread": null,
"chamfer": null,
"depth": null,
"test_dimension": null
},
"warnings": [],
"confidence": 0.9940671947860077
},
{
"position": null,
"measure_id": "394d55c9-538d-42f8-82f8-8f6c26b80bfb",
"label": {
"blurb": "\u00d812 H7 +0.018/0",
"quantity": 1,
"size": {
"blurb": "\u00d812",
"size_type": "DIAMETER",
"nominal_size": 12
},
"size_tolerance": {
"toleration_type": "FIT_SIZE_ISO",
"blurb": "H7",
"deviation_lower": 0.0,
"deviation_upper": 0.018,
"fundamental_deviation": "H",
"tolerance_grade": {
"grade": 7.0,
"warning": null
}
},
"unit": "MILLIMETER",
"thread": null,
"chamfer": null,
"depth": null,
"test_dimension": null
},
"warnings": [],
"confidence": 0.9926147474148197
},
{
"position": null,
"measure_id": "00404cc5-66e4-4dbc-86e8-d9fd750ee352",
"label": {
"blurb": "9 +0.05/0",
"quantity": 1,
"size": {
"blurb": "9",
"size_type": "NOMINAL",
"nominal_size": 9
},
"size_tolerance": {
"toleration_type": "OFF_SIZE",
"blurb": "0/0.05",
"deviation_lower": 0.0,
"deviation_upper": 0.05,
"tolerance_grade": {
"grade": 9.0,
"warning": null
}
},
"unit": "MILLIMETER",
"thread": null,
"chamfer": null,
"depth": null,
"test_dimension": null
},
"warnings": [],
"confidence": 0.9926147474148197
},
{
"position": null,
"measure_id": "80f3ffd8-db7a-4c02-89b0-072e92f2f7d3",
"label": {
"blurb": "23 +0.05/-0.05",
"quantity": 1,
"size": {
"blurb": "23",
"size_type": "NOMINAL",
"nominal_size": 23
},
"size_tolerance": {
"toleration_type": "OFF_SIZE",
"blurb": "\u00b10.05",
"deviation_lower": -0.05,
"deviation_upper": 0.05,
"tolerance_grade": {
"grade": 10.0,
"warning": null
}
},
"unit": "MILLIMETER",
"thread": null,
"chamfer": null,
"depth": null,
"test_dimension": null
},
"warnings": [],
"confidence": 0.9930567966147466
}
],
"gdts": [
{
"position": null,
"bounding_polygon": [],
"frame": {
"gdt_id": null,
"blurb": "[\u2197|0.02|A]",
"characteristic": "\u2197",
"zone_shape": null,
"zone_value": {
"blurb": "0.02",
"width_min": 0.02,
"width_max": null,
"extend_quantity": null,
"extend_shape": null,
"extend_value": null,
"extend_angle": null
},
"zone_combinations": [],
"zone_offset": null,
"zone_constraint": null,
"feature_filter": null,
"feature_associated": null,
"feature_derived": null,
"reference_association": null,
"reference_parameter": null,
"material_condition": null,
"state": null,
"data": [
{
"blurb": "A"
}
]
}
},
{
"position": null,
"bounding_polygon": [],
"frame": {
"gdt_id": null,
"blurb": "[A]",
"characteristic": "[DATUM]",
"zone_shape": null,
"zone_value": null,
"zone_combinations": [],
"zone_offset": null,
"zone_constraint": null,
"feature_filter": null,
"feature_associated": null,
"feature_derived": null,
"reference_association": null,
"reference_parameter": null,
"material_condition": null,
"state": null,
"data": [
{
"blurb": "A"
}
]
}
}
],
"radii": [],
"roughnesses": [
{
"position": null,
"roughness_id": "1a190f2f-c1ae-4c67-9f13-f530908af450",
"label": {
"blurb": "\u25bd\u221aURa(DIN) 12.5",
"blurb_html": "",
"standard": "ISO 1302:2002",
"machining_allowance": null,
"material_removal_type": "REQUIRED",
"applies_all_around": false,
"direction_of_lay": null,
"manufacturing_method": {
"blurb": "None"
},
"conditions": [
{
"blurb": "URa(DIN) 12.5",
"condition_type": "U",
"filter_type": "G",
"lambda_s": 0.03,
"lambda_c": 0.8,
"parameter": "Ra(DIN)",
"evaluation_length": {
"evaluation_length_type": "LAMBDA_C_MULTIPLE",
"length": 4.0,
"length_unit": "MILLIMETER",
"lambda_c_multiple": 5
},
"acceptance_criterion": "16%",
"value": 12.5,
"roughness_grade": {
"blurb": "N7",
"grade": "7"
}
}
],
"unit_system": "METRIC",
"waviness": null
}
},
{
"position": null,
"roughness_id": "26b47620-74ff-4401-b722-58e91077359b",
"label": {
"blurb": "\u25bd\u221aURa(DIN) 3.2",
"blurb_html": "",
"standard": "ISO 1302:2002",
"machining_allowance": null,
"material_removal_type": "REQUIRED",
"applies_all_around": false,
"direction_of_lay": null,
"manufacturing_method": {
"blurb": "None"
},
"conditions": [
{
"blurb": "URa(DIN) 3.2",
"condition_type": "U",
"filter_type": "G",
"lambda_s": 0.03,
"lambda_c": 0.8,
"parameter": "Ra(DIN)",
"evaluation_length": {
"evaluation_length_type": "LAMBDA_C_MULTIPLE",
"length": 4.0,
"length_unit": "MILLIMETER",
"lambda_c_multiple": 5
},
"acceptance_criterion": "16%",
"value": 3.2,
"roughness_grade": {
"blurb": "N7",
"grade": "7"
}
}
],
"unit_system": "METRIC",
"waviness": null
}
}
]
}
Error Handling¶
Things do not always run smoothly. When you request the Designation, the following exceptions might be triggered.
Exception Type | Level | Description |
---|---|---|
DRAWING_FILE_FORMAT_UNSUPPORTED | ERROR | The drawing could not be read in any of the supported file formats. Refer to Limitations/DrawingFileFormats for details. |
DRAWING_FILE_SIZE_TOO_LARGE | ERROR | The drawing exceeded the file size limit. Refer to Limitations/DrawingFileSize for details. |
DRAWING_RESOLUTION_TOO_LOW | ERROR | The drawing has a low resolution and could not be read. Refer to Limitations/DrawngResolution for details. |
DRAWING_CONTENT_NOT_UNDERSTOOD | ERROR | The file could not be interpreted as Technical Drawing or does not contain a TitleBlock. |
FAQs¶
How do I access the GD&Ts characteristic as clear name?¶
The WERK24 client allows you to access the characteristics in a very easy way.
```python gdt.frame.characteristic.name
``` This is because the GD&T characteristic is internally implemented as Enum.