BIM360使用ModelDerivativeAPI无法查看SVF2视图页面
创始人
2024-12-16 00:00:22
0

问题可能是由于缺少访问BIM360存储的权限所致。请尝试使用以下代码示例来授权BIM360存储的访问权限:

const token = ''; // Your access token here const urn = ''; // Your model URN here const projectId = ''; // Your BIM 360 project ID here const folderId = ''; // Your folder ID here const objectId = ''; // Your object ID here

async function authorizeAccessToken() { try { const authorization = await fetch(https://developer.api.autodesk.com/authorization/v1/access_token, { method: 'POST', headers: { 'Authorization': Bearer ${token} } });

const data = await authorization.json();

return data.access_token;

} catch (err) { console.error(err); throw new Error(err); } }

async function authorizeBucketAccess(accessToken) { try { const authorization = await fetch(https://developer.api.autodesk.com/oss/v2/buckets/${projectId}/policy?key=${folderId}/${objectId}, { method: 'POST', headers: { 'Authorization': Bearer ${accessToken} }, body: JSON.stringify({ 'access': 'full', 'expiresInMinutes': 60 }) });

const data = await authorization.json();

return authorization.status === 200;

} catch (err) { console.error(err); throw new Error(err); } }

async function checkSVF2View(accessToken) { try { const view = await fetch(https://developer.api.autodesk.com/modelderivative/v2/designdata/${urn}/metadata, { method: 'GET', headers: { 'Authorization': Bearer ${accessToken} } });

const data = await view.json();

return data.metadata && data.metadata.length > 0 && data.metadata[0].derivatives.some(derivative => derivative.outputType === 'svf' && derivative.children.some(child => child.type === 'geometry' && child.role

相关内容

热门资讯

最新消息!红龙poker辅助平... 最新消息!红龙poker辅助平台,德普之星的辅助工具介绍,一贯真的是有挂(有挂解惑)1、操作简单,无...
最新技巧!hhpoker智能辅... 最新技巧!hhpoker智能辅助插件,hhpoker免费透视脚本,其实有挂(有挂总结)1、破解器简单...
为切实保障!wepoker底牌... 为切实保障!wepoker底牌透视,德扑之星辅助器怎么用,都是是有挂(有挂规律)1、玩家可以在德扑之...
玩家必看科普!wpk有那种辅助... 玩家必看科普!wpk有那种辅助吗,hhpoker怎么破解,一直真的有挂(真的有挂)1、玩家必看科普!...
出现新变化!wepoker透视... 出现新变化!wepoker透视有没有,智星德州插件怎么下载,竟然是真的有挂(有挂技巧)1、上手简单,...
一起来探讨!werplan外卦... 您好,这款游戏可以开挂的,确实是有挂的,需要了解加去威信【136704302】很多玩家在这款游戏中打...
第三方技巧!wepoker怎么... 第三方技巧!wepoker怎么拿到好牌,智星德州插件,一直存在有挂(有挂实锤)在进入智星德州插件软件...
实测必看!wepoker怎么开... 实测必看!wepoker怎么开辅助,wepoker有辅助功能吗,真是是有挂(真是有挂)进入游戏-大厅...
截至发稿!wepoker辅助器... 截至发稿!wepoker辅助器官方,德普之星私人局透视,确实是有挂(有挂工具)1、首先打开德普之星私...
一分钟了解!wpk有辅助器吗,... 一分钟了解!wpk有辅助器吗,wpk辅助插件,其实存在有挂(有挂教学)辅助器是一种具有地方特色的麻将...