Message 1 of 2
Calling document.dataFile raises error if document was just saved to datafile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
# Document creation options
documentType = adsk.core.DocumentTypes.FusionDesignDocumentType # int 0
visible = True # Fusion currently only supports True
options = None
doc = app.documents.add(documentType, visible, options)
description = ''
tag = ''
# Save version 1
doc.saveAs(datafile_name, folder, description, tag)
time.sleep(15) # testing, arbitrary
doc.activate()
# Workaround to Fusion's 'Failed to download file' error
time.sleep(6)
print('doc.isSaved: ' + str(doc.isSaved))
print('doc.isValid: ' + str(doc.isValid))
print('doc.dataFile: ' + str(doc.dataFile))
Output:
doc.isSaved: True
doc.isValid: True
[...]
RUntimeError: 2 : InternalValidationError : dataFile