Skip to content

AskMetaData

Request

AskMetaData is a request object used to extract the meta data about a mechanical component from a technical drawing. Most of the meta data would typically be on the title block, but they can also be on other places (e.g, the notes section).

Example Usage

from werk24 import AskMetaData, read_example_drawing

read_example_drawing([AskMetaData()])

Response

Bases: Response

ResponseMetaData represents the structured response to a metadata request (AskMetaData) for a mechanical component drawing. This response provides essential details such as identifiers, material options, unit systems, general tolerances, and other metadata extracted from the drawing.

The response enables better integration with manufacturing systems, PLM (Product Lifecycle Management), and ERP systems by providing structured component details.

PARAMETER DESCRIPTION
ask_version

TYPE: Literal[str] DEFAULT: 'v2'

ask_type

TYPE: Literal[AskType] DEFAULT: <AskType.META_DATA: 'META_DATA'>

page_type

TYPE: Literal[PageType] DEFAULT: <PageType.COMPONENT_DRAWING: 'COMPONENT_DRAWING'>

bill_of_material

Bill of materials for the component, listing parts and quantities.

TYPE: BillOfMaterial | None DEFAULT: None

designation

Designation of the component.

TYPE: list[Entry] DEFAULT: <dynamic>

identifiers

List of identifiers associated with the component.

TYPE: List[Identifier] DEFAULT: <dynamic>

general_roughness

General roughness specifications for the component.

TYPE: Roughness | None DEFAULT: None

general_tolerances

General tolerance specifications for the component.

TYPE: GeneralTolerances | None DEFAULT: None

languages

Languages used in the drawing.

TYPE: List[Language] DEFAULT: <dynamic>

material_options

Material options available for the component.

TYPE: List[MaterialCombination] DEFAULT: <dynamic>

projection_method

Projection method used in the drawing (e.g., first angle or third angle).

TYPE: ProjectionMethod | None DEFAULT: None

unit_systems

The units specification for the component.

TYPE: List[UnitSystem] DEFAULT: <dynamic>

weight

Weight of the component.

TYPE: Weight | None DEFAULT: None

Source code in werk24/models/v2/responses.py
class ResponseMetaDataComponentDrawing(Response):
    """
    `ResponseMetaData` represents the structured response to a metadata request (AskMetaData)
    for a mechanical component drawing. This response provides essential details such as identifiers,
    material options, unit systems, general tolerances, and other metadata extracted from the drawing.

    The response enables better integration with manufacturing systems,
    PLM (Product Lifecycle Management), and ERP systems by providing structured component details.
    """

    model_config = ConfigDict(arbitrary_types_allowed=True)

    ask_type: Literal[AskType.META_DATA] = AskType.META_DATA
    page_type: Literal[PageType.COMPONENT_DRAWING] = PageType.COMPONENT_DRAWING

    bill_of_material: Optional[BillOfMaterial] = Field(
        None,
        description="Bill of materials for the component, listing parts and quantities.",
    )
    designation: list[Entry] = Field(
        default_factory=list,
        description="Designation of the component.",
    )
    identifiers: List[Identifier] = Field(
        default_factory=list,
        description="List of identifiers associated with the component.",
    )
    general_roughness: Optional[Roughness] = Field(
        None,
        description="General roughness specifications for the component.",
    )
    general_tolerances: Optional[GeneralTolerances] = Field(
        None,
        description="General tolerance specifications for the component.",
    )
    languages: List[Language] = Field(
        default_factory=list,
        description="Languages used in the drawing.",
    )
    material_options: List[MaterialCombination] = Field(
        default_factory=list,
        description="Material options available for the component.",
    )
    projection_method: Optional[ProjectionMethod] = Field(
        None,
        description="Projection method used in the drawing (e.g., first angle or third angle).",
    )
    unit_systems: List[UnitSystem] = Field(
        default_factory=list,
        description="The units specification for the component.",
    )
    weight: Optional[Weight] = Field(
        None,
        description="Weight of the component.",
    )

Example Response

{
    "ask_version": "v2",
    "ask_type": "META_DATA",
    "page_type": "COMPONENT_DRAWING",
    "identifiers": [
        {
            "reference_id": 0,
            "language": null,
            "value": "WK2401",
            "identifier_type": "DRAWING_NUMBER",
            "stakeholder": null,
            "period": null
        }
    ],
    "designation": [
        {
            "reference_id": 1,
            "language": null,
            "value": "ADAPTER"
        }
    ],
    "languages": [
        "ENG"
    ],
    "general_tolerances": null,
    "general_roughness": {
        "reference_id": 2,
        "label": "\u221a",
        "confidence": null,
        "standard": "ISO 1302:2002",
        "machining_allowance": null,
        "material_removal_type": "UNSPECIFIED",
        "applies_all_around": false,
        "direction_of_lay": null,
        "manufacturing_process": "",
        "conditions": [],
        "waviness": null
    },
    "material_options": [
        {
            "reference_id": 3,
            "material_combination": [
                {
                    "raw_ocr": "20MnCr5",
                    "standard": "DIN EN 10084",
                    "designation": "20MnCr5",
                    "material_category": [
                        "FERROUS_ALLOY",
                        "STEEL",
                        "STRUCTURAL_OR_CONSTRUCTIONAL_STEEL"
                    ]
                }
            ]
        }
    ],
    "weight": {
        "reference_id": 4,
        "value": "1.025",
        "unit": "kilogram"
    },
    "projection_method": {
        "reference_id": 5,
        "projection_method": "FIRST_ANGLE"
    },
    "bill_of_material": null,
    "unit_systems": [
        {
            "reference_id": 6,
            "unit_system_type": "METRIC"
        }
    ]
}