Fusion 360 API equivalent for "Get Latest Version"

Fusion 360 API equivalent for "Get Latest Version"

tomveuskens
Participant Participant
684 Views
3 Replies
Message 1 of 4

Fusion 360 API equivalent for "Get Latest Version"

tomveuskens
Participant
Participant

Hello everyone

 

Does anyone know if there is an equivalent in the API to refresh a design once it has been updated by a different Fusion instance? Similar to clicking the "Get Latest Version" button?

tomveuskens_0-1676476472679.png

 

Thank you!

 

 

0 Likes
Accepted solutions (1)
685 Views
3 Replies
Replies (3)
Message 2 of 4

kandennti
Mentor
Mentor
Accepted solution
0 Likes
Message 3 of 4

tomveuskens
Participant
Participant

Dear @kandennti 

 

Thank you for getting back to me.

 

The Document.updateAllReferences method consistently triggers 

RuntimeError: 3: update all references not allowed on this document

for me.

 

The text command you referred to, however, works perfectly.

 

Thank you very much.

 

All the best

Tom

0 Likes
Message 4 of 4

en9y37
Advocate
Advocate

Hi @tomveuskens 

 

That happened to me too. The point is that if the document doesn't need an update, you will get that error. So, to avoid it, you only have to add this condition:

 

    design = adsk.fusion.Design.cast(app.activeProduct)
    if not design.parentDocument.isUpToDate:
        design.parentDocument.updateAllReferences()

 

I hope it helps

0 Likes