0
votes

I am trying to set up a Revit model viewer that gets updates when someone changes a model. I am not a Revit pro at all so bear with me. I've successfully uploaded a model up on a server which is pretty neat, but if I update my model and run the upload again of the same filename (but different contents) I'm given a message that my upload is complete immediately and no update occurs.

I've followed two guides to get this set up https://forge.autodesk.com/en/docs/viewer/v2/tutorials/basic-viewer/

The above allowed me to set up the html form and bucket and everything

And I copied this code https://github.com/jaimerosales/modelderivative-nodejs-tutorial/blob/master/uploader.js as the uploader. I run uploader.js after I've updated my revit model and I see no update on my server. The only difference on the CLI is that the first time I run uploader.js I see:

**** Getting File Manifest Status
The status of your file is pending Please wait while we finish Translating your file
The percentage of your file is 0% complete

After the second time I run uploader.js (after updating the model) I see

**** Getting File Manifest Status
**** success
**** complete
**** Your File is ready for viewing

So it looks like there is no upload even happening anymore and it just takes on the file that is already uploaded. I've looked into https://www.npmjs.com/package/forge-apis and the various endpoints, but none seem to be what I am looking for. Is this an intended feature?

1

1 Answers

1
votes

As a solution, you can probably rename your revit file and upload and it’ll generate a new object name which will force the translation.

Furthermore, you can see here in the uploader.js file that the translateFile wrapper on the forge-apis derivativeApi translate endpoint that’s a Boolean parameter if it should retranslate the same model:

 @param {Boolean} opts.xAdsForce `true`: the endpoint replaces previously translated output file types with the newly generated derivatives  
`false` (default): previously created derivatives are not replaced  (default to false)
 * data is of type: {module:model/Job}

Therefore you can investigate how to call the uploader.js translateFile function with that specific options configuration, or you can use the forge-apis module directly and add xAdsForce:true specification to the header of the translate api call.