0

I want to custom translate a model in the forge configurator inventor. This model will be a model that is created and cached after the update process. I want to translate the abc.iam file in the "cache / projectid / hash / model.zip" file and get the urn after this operation.

I couldn't find the document about translate object custom. Also, how can I do this with the model in the cache of this project?

hamdi
  • 67
  • 2
  • 10
  • When you update a model the default way in the sample it generates the necessary SVF content as well so you can display it in the Viewer. Since you are asking about the "urn" of the file and translation, I assume you also want to get the model translated using the model derivative service? What are you trying to translate it to? – Adam Nagy May 14 '21 at 08:40

1 Answers1

0

This is how the content is organized - highlighted the bucket name: enter image description here

You can either use the https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectName-details-GET/ endpoint to get the ObjectId of the file or construct it yourself based on the template: urn:adsk.objects:os.object:<bucket name>/<file name URL encoded> Note: make sure the file name is URL encoded if making the REST call directly instead of using the Forge SDK

You can see what ObjectId is provided for a given file e.g. using the Autodesk Forge Tools Extension in VS Code: enter image description here

You need to base64 encode the ObjectId in order to get the urn of the file and then use that to kick off the translation: https://forge.autodesk.com/en/docs/model-derivative/v2/tutorials/translate-zip-to-stl/

In case of a zip file you also have to provide the rootFilename (it's pointed out in the sample referenced above) - in case of e.g. the Wheel assembly that's the WheelAssembly.iam file enter image description here

Adam Nagy
  • 1,700
  • 1
  • 9
  • 14
  • Thank you for your answer Adam, I guessed I could find urn this way and now I can. But there is a problem with translating the file. I followed the steps in the API document step by step. I'm also trying on the postman. But it does not translate. When I do the transalate process by using the vs code extension and giving the root file name, I can use this model on another viewer. But when I send rootfilename and compressedUrn with the api, the translation process does not occur. – hamdi May 17 '21 at 13:35
  • What I want to do is simply add the new model created after the update process to another model. For example, the door has updated its properties and the files have arrived with the new hash. I want to translate this new model with urn and rootfile and add it to the wall in another model. – hamdi May 17 '21 at 13:48
  • I was translating the model to the wrong format. Once converted to SVF format, I can use it in another viewer. Thanks Adam – hamdi May 18 '21 at 06:28