Downloading or exporting 3D model

Downloading or exporting 3D model

krisztian_toth
Explorer Explorer
1,002 Views
2 Replies
Message 1 of 3

Downloading or exporting 3D model

krisztian_toth
Explorer
Explorer

Hello, 
I am working on extension and trying to find a way to get the 3D model or export the selection.  The 3D model is either the model placed from Library for proposal or the created geometry. 
Is there way to find the storage path based on key or urn?
Thanks in advance!

Accepted solutions (1)
1,003 Views
2 Replies
Replies (2)
Message 2 of 3

marthe.brondbo
Alumni
Alumni

Hi again Kristian! 
Found your question - will chase someone to get this answered! And thank you again for showing us your progress on the POC!
Marthe

Message 3 of 3

magnus.poppe.wang
Autodesk
Autodesk
Accepted solution

Hi @krisztian_toth! 
It seems from your question that you're using the Forma SDK. Given that you have the URN, there are two steps to downloading the geometry data:
1. Get the element using:

const { element } = await Forma.elements.get({
  urn: <insert-urn-here>,
})


2. From the representation you want on that element, you will need to get the Blob of that element's representation:

// The blob is unknown data. For volumeMesh, you will get binary GLB.
const blobResponse = await Forma.elements.blobs.get({
  blobId: element.representations.volumeMesh.blobId,
})
const arrayBuffer: ArrayBuffer = blobResponse.data

See the Blob API for more information: https://app.autodeskforma.com/forma-embedded-view-sdk/docs/classes/elements.BlobsApi.html

Here are the different representations and what data they will include: https://app.autodeskforma.com/forma-embedded-view-sdk/docs/modules/elements.Representation.html

As for selection, you can use the Selection API to subscribe to when the selection in the scene changes. See https://app.autodeskforma.com/forma-embedded-view-sdk/docs/classes/scene_selection.SelectionApi.html...

Please let me know if this helps you