1

I've been following the Autodesk Model Derive API tutorial on Extracting Data From a Source File and keep getting a Translation Failure when attempting to convert the uploaded source file to SVF.

I have tried .step, .sldprt, .stl and .igs files (supported file extensions here), but all seem to throw the same error message.

The request

def self.convert_to_svf(urn, key)
  url = URI("https://developer.api.autodesk.com/modelderivative/v2/designdata/job")
  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true

  body = {"input": { "urn": "#{urn}", "compressedUrn": true, "rootFilename": "#{key}" }, "output": { "formats": [{ "type": "svf", "views": ["2d", "3d"] }] }}

  request = Net::HTTP::Post.new(url)
  request["content-type"] = 'application/json'
  request["authorization"] = 'Bearer ' + token
  request.body = body.to_json
  JSON.parse(http.request(request).read_body)
end

The response

{"type"=>"manifest", "hasThumbnail"=>"false", "status"=>"failed", "progress"=>"complete", "region"=>"US", "urn"=>"dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6aXNvcXVlLzE4Ynk4cG9pbnQ1X2dvb2R5ZWFyLmlncw", "derivatives"=>[{"name"=>"LMV Bubble", "hasThumbnail"=>"false", "status"=>"failed", "progress"=>"complete", "messages"=>[{"type"=>"error", "message"=>"Translation failure", "code"=>"TranslationWorker-InternalFailure"}], "outputType"=>"svf"}]}

1 Answers1

3

I did not see an obvious issue in your code snippet, however may I know if you have uploaded the source file(s) in zip format or only the single file of the original format (say .step, .sldprt, .stl and .igs) ?

I had the practice on the relevant APIs. I tested with Inventor assembly (with sub-assemblies and parts) and AutoCAD drawing (with Xrefs). The endpoint can work well with compressedUrn = true, specifying root file, after I uploaded file package in a zip.

If compressedUrn = true, that means the source file is compressed (zip), but this applies to the composite files, i.e. a main file has some dependent files. If it is a single file which has no dependent files, upload the source file directly, then call/modelderivative/v2/designdata/job without specifying compressedUrn and rootFilename.

If I misunderstood your question, could you provide a bit more information or a demo dataset? Note, do not post any data that is confidential to your company.

Xiaodong Liang
  • 2,051
  • 2
  • 9
  • 14