0

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/

Shabbir Haider
  • 158
  • 1
  • 10

2 Answers2

1

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

gamingumar
  • 979
  • 8
  • 14
0

For the 2d views in Revit, the short answer is that Forge does not support translating 2d views to vector images or high resolution images as you wanted.

But here is some additional information in case this is also workable for you. You can use Model Derivative API to translate the 2d views into f2d format, just make sure to set the output.formats.views to both "2d" and "3d". You can not open this f2d file directly, but only through the Viewer3D library to load it into browser just as same as svf file, check the doc and tutorials here, the result looks as follow, and you can use http://lmv.ninja.autodesk.com to play with a 2d sheet and see how it works in browser.

enter image description here

Zhong Wu
  • 1,721
  • 1
  • 8
  • 9