Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
QilongTang committed Mar 8, 2024
1 parent 8dd6381 commit d240f3e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/DynamoAssistantViewExtension/DynamoAssistantWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,16 @@
Height="50"
Background="#2d2d2d"
Foreground="White"
Grid.Row="2"/>
Grid.Row="2"
Click="MakeNoteButton_Click"/>
<Button
Content="Make groups for me"
Width="400"
Height="50"
Background="#2d2d2d"
Foreground="White"
Grid.Row="3"/>
Grid.Row="3"
Click="MakeGroupButton_Click"/>
<Button
Content="Optimize my graph for me"
Width="400"
Expand Down
10 changes: 10 additions & 0 deletions src/DynamoAssistantViewExtension/DynamoAssistantWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,15 @@ private void WhatsNewButton_Click(object sender, RoutedEventArgs e)
{
ViewModel.WhatsNew();
}

private void MakeNoteButton_Click(object sender, RoutedEventArgs e)
{
ViewModel.MakeNote();
}

private void MakeGroupButton_Click(object sender, RoutedEventArgs e)
{
ViewModel.MakeGroup();
}
}
}
16 changes: 13 additions & 3 deletions src/DynamoAssistantViewExtension/DynamoAssistantWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,14 @@ internal async void SendMessage(string msg)
{
CreatePythonNode(response);
}
// create a Dynamo note example
// CreateNote((new Guid()).ToString(), "This is a sample Note.", 0, 0, true);
IsWaitingForInput = true;
}

internal async void DescribeGraph()
{
// Set Dynamo file location
string filePath = readyParams.CurrentWorkspaceModel.FileName;
if (filePath == null)
if (string.IsNullOrEmpty(filePath))
{
// Alternatively, export Json from current workspace model to continue
Messages.Add("Copilot:\nPlease save the workspace first.\n");
Expand Down Expand Up @@ -148,6 +146,18 @@ internal async void WhatsNew()
Messages.Add("Copilot:\n" + response + "\n");
}

internal void MakeNote()
{
// create a Dynamo note example
CreateNote((new Guid()).ToString(), "This is a sample Note.", 0, 0, true);
}

internal void MakeGroup()
{
// create a Dynamo group example
dynamoModel.ExecuteCommand(new DynamoModel.CreateAnnotationCommand(new Guid(), "This is a sample Group.", string.Empty, 0, 0, true));
}

/// <summary>
/// Create a python node in Dynamo, use latest Nuget package for this
/// </summary>
Expand Down

0 comments on commit d240f3e

Please sign in to comment.