Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Added hub selection dialog #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions Fusion 360 Total Export.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,22 @@ def run(self, context):

def _export_data(self, output_path):
progress_dialog = self.ui.createProgressDialog()
progress_dialog.show("Exporting data!", "", 0, 1, 1)

all_hubs = self.data.dataHubs
for hub_index in range(all_hubs.count):

hub = all_hubs.item(hub_index)

#export_this_hub = self.ui.messageBox("Export Hub \"{}\"?".format(hub.name), "Shall this Hub be exported?", adsk.core.YesNoButtonType, adsk.core.QuestionIconType)
export_this_hub = self.ui.messageBox("Export hub \"{}\"?".format(hub.name), "Shall this hub be exported?", 3, 1)

#if export_this_hub == adsk.core.DialogNo:
if export_this_hub == 3:
self.log.info("Skipping hub \"{}\" due to user request!".format(hub.name))
continue

# progress_dialog has to be created and shown here, or otherwise no interaction with the hub selection dialog is possible.
progress_dialog.show("Exporting data!", "", 0, 1, 1)

self.log.info("Exporting hub \"{}\"".format(hub.name))

all_projects = hub.dataProjects
Expand Down Expand Up @@ -105,6 +115,9 @@ def _export_data(self, output_path):
self._write_data_file(output_path, file)
self.log.info("Finished exporting project \"{}\"".format(project.name))
self.log.info("Finished exporting hub \"{}\"".format(hub.name))
progress_dialog.hide() # Closing the progress bar dialog for the current hub to gain focus back to the hub selection dialog

self.ui.messageBox("No more Hubs to export from!", "Finished")

def _ask_for_output_path(self):
folder_dialog = self.ui.createFolderDialog()
Expand Down