I have translated some DWG files into SVFs using the Model Derivative API. I kept track of the returned URNS and I'm able to view each translated file in the Forge viewer.
Since I used a persistent retention policy, those original DWG files are apparently stored somewhere in the Forge cloud.
Now, I want to run CAD scripts on one of those stored DWG files using the Design Automation API and send the output to some other cloud storage (Dropbox etc).
Is there a way to get the URL for one of those original DWGs based on the URN of its translated SVF and then use that URL as the input to a Design Automation Activity?
The short answer is Yes, you can use the file that uploaded to Autodesk storage as an input of Design Automation, just input the file link and access token.
We are about to release the Design Automation V3, so I use that version for example, but the way applies to V2.
You have 2 ways to use the link of your DWG file:
Use the file link directly with access token, when you upload your file to Autodesk storage or list all the content from on bucket, you should get the location property, and use that url with access directly as input url.
You can also create a signed URL for the original link to be used as input/output, for details, please refer Sign URL and Post workitem.
Here is one of my sample workitem request body, it includes both ways:
{
"activityId":"{{dasNickName}}.FileUpgraderActivity+prod",
"arguments":{
"rvtFile":{
"url":"https://developer.api.autodesk.com/oss/v2/buckets/revitiosample/objects/RevitNative.rvt",
"Headers":{
"Authorization":"Bearer {{dataApiToken}}"
}
},
"resultrvt":{
"verb":"put",
"url":"https://developer.api.autodesk.com/oss/v2/signedresources/***-****?region=US"
}
}
}