- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there.
It is possible that I am missing something. I would appreciate it if you know how to do this.
The following script will output the number of Application.documents and the name of the data file to be retrieved.
# Fusion360API Python script
import traceback
import adsk.fusion
import adsk.core
def run(context):
ui: adsk.core.UserInterface = None
try:
app: adsk.core.Application = adsk.core.Application.get()
ui = app.userInterface
docs: adsk.core.Documents = app.documents
app.log(f'-- Documents Count:{docs.count} --')
for doc in docs:
df: adsk.core.DataFile = doc.dataFile
app.log(f'{df.name}.{df.fileExtension}')
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
If the script is executed with only one drawing file open in the GUI, the related f3d documents will also be listed.
Is there any way to determine which document is actually open in the GUI from the Application.documents?
Solved! Go to Solution.