简体   繁体   中英

Is there a way to create an ACC Docs item(version) from a design derivative?

The use case is very simple: We have Autodesk Revit files, which are hosted on Autodesk Construction Cloud (Docs) and want to convert them to IFC. Users should be able to download the resulting IFC from ACC Docs.

To achieve this, we successfully used the model derivative api (POST job) to convert the file to the IFC format. Using the GET {urn}/manifest endpoint, we get the derivative urns, which we can use to download the ifc with the GET {urn}/manifest/{derivativeurn} endpoint.

However, we also want the file to appear on ACC Docs, so that users can actually download it from there.

We tried to use the derivative urn ( for example urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6d2lwLmRtLmVtZWEuMi80NjdmOGQzNC03ZDZhLTQ2YzEtOTNhYy04ZWQ2NTk3YmE1ZWEucnZ0/output/Resource/IFC/pr2021_host.ifc ) and tried to create a new ACC docs item with that, using the POST projects/:project_id/items endpoint. However, this results in a 500 status code (server error).

Is there a way doing this without having to first download the file from the GET {urn}/manifest/{derivativeurn} endpoint, then creating a storage location ( POST projects/:project_id/storage ), upload the file using PUT buckets/:bucketKey/objects/:objectKey and finally creating the items version with POST projects/:project_id/items ? This seems very complicated, given that there already is a storage location (=derivative urn).

I don't think there's a way of sending the derivative result (in your case the IFC file) directly to OSS. You will need to download the file first and then upload it to OSS using PUT buckets/:bucketKey/objects/:objectKey .

If you're worried about performance and memory usage, you could try using streams, ie, getting the IFC file from the Model Derivative service as a readable stream, and redirect it to the OSS upload request.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM