Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
351 views
in Technique[技术] by (71.8m points)

autodesk forge - How can I download plan pdf file by bim360 api or sdk?

According to the documentation (https://forge.autodesk.com/en/docs/data/v2/tutorials/download-file/) I should get the storage object id from included.relationships.storage.data.id. I can do it for all files uploaded to the bim360 except plans pdf files. There is nothing about 'storage' in a whole response.

Here is "included" from my response:

''' "included": [ { "type": "versions", "id": "XXX", "attributes": { "name": "1ST FLOOR PLAN", "displayName": "1ST FLOOR PLAN", "createTime": "2019-01-10T09:19:16Z", "createUserId": "3MYGKJ73V3SD", "createUserName": "XXX", "lastModifiedTime": "2019-01-10T09:19:19Z", "lastModifiedUserId": "XXX", "lastModifiedUserName": "XXX", "versionNumber": 1, "extension": { "type": "versions:autodesk.bim360:Document", "version": "1.0", "schema": { "href": "https://developer.api.autodesk.com/schema/v1/versions/versions:autodesk.bim360:Document-1.0" }, "data": { "processState": "PROCESSING_COMPLETE", "viewableId": "1", "viewableGuid": "XXX", "viewableName": "(1)", "viewableOrder": 1, "sourceFileName": "A1-1 DIMS FIRST FLOOR DIMENSION PLAN_V1_2019-01-10_09-54-54am.pdf" } } }, "links": { "self": { "href": "XXX" } }, "relationships": { "item": { "data": { "type": "items", "id": "XXX" }, "links": { "related": { "href": "XXX" } } }, "refs": { "links": { "self": { "href": "XXX" }, "related": { "href": "XXX" } } }, "links": { "links": { "self": { "href": "XXX" } } }, "downloadFormats": { "links": { "related": { "href": "XXX" } } } } } ] '''

How can I deal with it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Yes, please call GET versions/:version_id/relationships/refs instead. Since the item listed in the Plan folder is a type of items:autodesk.bim360:Document, this type item won't have storage attribute shown in its responses of GET versions/:version_id and GET items/:item_id directly. see also here: Download a Document with Autodesk API


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...