Skip to content

Commit b3fe5a9

Browse files
committed
Only create group when >1 timeline items added
1 parent c4a3c78 commit b3fe5a9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/panelUtils/panel_command.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,9 @@ def generatePanel(args: adsk.core.CommandEventArgs):
129129

130130
# group features in timeline
131131
count = panelComponent.sketches.count + panelComponent.features.count + panelComponent.constructionAxes.count + panelComponent.constructionPlanes.count
132-
panelGroup = des.timeline.timelineGroups.add(newCmpOcc.timelineObject.index, newCmpOcc.timelineObject.index + count)
133-
panelGroup.name = componentName
132+
if count > 1:
133+
panelGroup = des.timeline.timelineGroups.add(newCmpOcc.timelineObject.index, newCmpOcc.timelineObject.index + count)
134+
panelGroup.name = componentName
134135
except Exception as err:
135136
args.executeFailed = True
136137
args.executeFailedMessage = getErrorMessage()

0 commit comments

Comments
 (0)