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!
Solved! Go to Solution.
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!
Solved! Go to Solution.
Solved by magnus.poppe.wang. Go to Solution.
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
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
Hi @kristian6PNQM!
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
Hi @kristian6PNQM!
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
Can't find what you're looking for? Ask the community or share your knowledge.