Skip to content

Commit 1e72d60

Browse files
Catch When No Design is Selected (#1099)
2 parents bbaf73b + a07d65c commit 1e72d60

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

exporter/SynthesisFusionAddin/src/UI/ConfigCommand.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,16 @@ def notify(self, args: adsk.core.CommandEventArgs) -> None:
317317
savepath = processedFileName
318318

319319
adsk.doEvents()
320+
320321
design = gm.app.activeDocument.design
321-
name = design.rootComponent.name.rsplit(" ", 1)[0]
322-
version = design.rootComponent.name.rsplit(" ", 1)[1]
322+
323+
name_split: list[str] = design.rootComponent.name.split(" ")
324+
if len(name_split) < 2:
325+
gm.ui.messageBox("Please open the robot design you would like to export", "Synthesis: Error")
326+
return
327+
328+
name = name_split[0]
329+
version = name_split[1]
323330

324331
selectedJoints, selectedWheels = jointConfigTab.getSelectedJointsAndWheels()
325332
selectedGamepieces = gamepieceConfigTab.getGamepieces()

0 commit comments

Comments
 (0)