我的目标是将 DWG 文件转换为可在 Forge Viewer 中使用并具有标记。在获取所有正确文件以使用脱机查看器的过程中,我正在尝试获取文件的清单和元数据。我想要元数据,以便我可以访问多边形 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 调用的。