Search code examples
autodesk-forgeautodeskautodesk-viewerautodesk-model-derivative

Extract vector images from Revit file


I was wondering if it's possible to extract Vector images from 2d views of revit files from forge api. I've used the following endpoint to achieve thumbnail of the views, but the thumbnails are very small (400 x 400)

https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-thumbnail-GET/

Is there a way I can extract high resolution image, (preferably in vector formate that can be zoomed in or out) from a 2d View ?

Here's an example that I've tried: https://jsfiddle.net/uLnvwyLa/


Solution

  • Use the Viewer screenshot API and run a headless browser, no UI interaction needed and can run server-side. This will definitely produce the highest quality thumbnails that you can possibly obtain. Here are links that may be helpful:

    https://github.com/GoogleChrome/puppeteer

    http://adndevblog.typepad.com/cloud_and_mobile/2015/05/screenshot-extension-manager-for-the-viewer.html

    See viewer.getScreenshot method:

    this.viewer.getScreenShot(
     width, height, (blob) => {
    

    Talked with Autodesk support Philippe