Skip to content

Hooks

The WERK24 API is designed to be asynchronous in nature. This allows you to show a PageThumbnail (typically available in 300-500 milliseconds) to your user, while we concurrently extract all Measures from the Technical Drawing (can take up to 50 seconds for complex files).

To keep your own code base as simple as possible, we use the Hook concept, which simply associates the Ask with a function that shall be called when the information becomes available.

Say you want to (i) save a page thumbnail and (ii) print the measures on the terminal. Then you would define the following hook:

hooks = [
    Hook(ask=W24AskPageThumbnail(), function=save_file),
    Hook(ask=W24AskVariantMeasures(), function=print)
]