Skip to content

Commit

Permalink
Catch When No Design is Selected (#1099)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonPacewic authored Aug 21, 2024
2 parents bbaf73b + a07d65c commit 1e72d60
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions exporter/SynthesisFusionAddin/src/UI/ConfigCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,16 @@ def notify(self, args: adsk.core.CommandEventArgs) -> None:
savepath = processedFileName

adsk.doEvents()

design = gm.app.activeDocument.design
name = design.rootComponent.name.rsplit(" ", 1)[0]
version = design.rootComponent.name.rsplit(" ", 1)[1]

name_split: list[str] = design.rootComponent.name.split(" ")
if len(name_split) < 2:
gm.ui.messageBox("Please open the robot design you would like to export", "Synthesis: Error")
return

name = name_split[0]
version = name_split[1]

selectedJoints, selectedWheels = jointConfigTab.getSelectedJointsAndWheels()
selectedGamepieces = gamepieceConfigTab.getGamepieces()
Expand Down

0 comments on commit 1e72d60

Please sign in to comment.