gpt4 book ai didi

java - Autodesk Forge 从转换后的 DWG 中获取 list 和元数据

转载 作者:行者123 更新时间:2023-12-01 09:40:35 26 4
gpt4 key购买 nike

我的目标是将 DWG 文件转换为可在 Forge Viewer 中使用并带有标记。在获取使用离线查看器的所有正确文件的过程中,我试图获取该文件的 list 和元数据。我想要元数据,以便我可以访问多边形 ID 进行标记。当我调用元数据时,它显示为空。我做错了什么?

我已上传并发送了 DWG 文件的 SVF 转换作业请求。

Convert File String
{"input":{"urn":"dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn"},"output":{"formats":[{"type":"svf","views":["2d","3d"]}]}}
HTTP/1.1 201 Created
Result{"result":"created","urn":"dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn","acceptedJobs":{"output":{"formats":[{"type":"svf","views":["2d","3d"]}]}}}
getManifest
https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/manifest
HTTP/1.1 200 OK
Result{"type":"manifest","hasThumbnail":"true","status":"success","progress":"complete","region":"US","urn":"dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn","derivatives":[{"name":"Floor_Plan_Sample.dwg","hasThumbnail":"true","status":"success","progress":"complete","outputType":"svf","children":[{"type":"geometry","role":"2d","name":"2D Views","status":"success","progress":"complete","hasThumbnail":"true","children":[{"type":"resource","mime":"image/png","resolution":[100,56],"role":"thumbnail","status":"success","urn":"urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/output/Floor_Plan_Sample-Model_100.png"},{"type":"resource","mime":"image/png","resolution":[200,113],"role":"thumbnail","status":"success","urn":"urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/output/Floor_Plan_Sample-Model_200.png"},{"type":"resource","mime":"image/png","resolution":[400,226],"role":"thumbnail","status":"success","urn":"urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/output/Floor_Plan_Sample-Model_400.png"},{"type":"resource","mime":"application/autodesk-f2d","role":"graphics","status":"success","urn":"urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/output/535e6d00-3822-110e-c53e-4df9301ee4c2_f2d/primaryGraphics.f2d"},{"type":"view","role":"2d","name":"Initial","viewbox":[-0.198947,2.65155,6.826102,5.357447]},{"type":"view","role":"2d","name":"1","viewbox":[1.753343,4.41829,5.463574,6.340082]}]},{"type":"geometry","role":"2d","name":"Layout1","status":"success","progress":"complete","hasThumbnail":"true","children":[{"type":"resource","mime":"image/png","resolution":[100,77],"role":"thumbnail","status":"success","urn":"urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/output/Floor_Plan_Sample-Layout1_100.png"},{"type":"resource","mime":"image/png","resolution":[200,154],"role":"thumbnail","status":"success","urn":"urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/output/Floor_Plan_Sample-Layout1_200.png"},{"type":"resource","mime":"image/png","resolution":[400,308],"role":"thumbnail","status":"success","urn":"urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/output/Floor_Plan_Sample-Layout1_400.png"},{"type":"resource","mime":"application/autodesk-f2d","role":"graphics","status":"success","urn":"urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/output/8fcb06e4-ab26-a304-62c0-7cf8f5ef0470_f2d/primaryGraphics.f2d"}]}]}]}
getMetadata
https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Z3JlZ2JpbWJ1Y2tldGZvdXIvRmxvb3JfUGxhbl9TYW1wbGUuZHdn/metadata
HTTP/1.1 200 OK
Result{"data":{"type":"metadata","metadata":[]}}

请注意,使用 node.js 提取器示例,它可以很好地处理同一文件,并且提取器会创建 manifest.json.gz 和metadata.json.gz 。我只是想了解它们是如何创建的以及 REST 调用的方式。

最佳答案

遗憾的是,模型衍生 API 尚不支持 2D 文档的元数据,例如 .dwg。我们正在努力在即将推出的 API 版本中提供此功能。

目前我想唯一的解决方法是下载软件包并对内容进行“逆向工程”。你可以看一下我的npm包download method implementation ,这仍然使用 v1 API,但完全可以工作。这应该能让您了解如何下载 svf 资源。

关于java - Autodesk Forge 从转换后的 DWG 中获取 list 和元数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38484668/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com