Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 8 additions & 3 deletions src/RhinoInside.Revit/GH/Guest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,17 @@ public static void ShowEditor()
/// <summary>
/// Show Grasshopper window asynchronously
/// </summary>
public static async void ShowEditorAsync()
internal static async void ShowEditorAsync()
{
// Yield execution back to Revit and show Grasshopper window asynchronously.
await External.ActivationGate.Yield();
var app = await External.ActivationGate.Yield();

ShowEditor();
try { ShowEditor(); }
catch (Exception e)
{
if (!External.UI.ExternalApplication.InvokeCatchException(app, e, null)) throw;
External.UI.ExternalApplication.InvokeReportException(app, e, null);
}
}

/// <summary>
Expand Down
9 changes: 7 additions & 2 deletions src/RhinoInside.Revit/Rhinoceros.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1012,9 +1012,14 @@ static void Show()

internal static async void ShowAsync()
{
await External.ActivationGate.Yield();
var app = await External.ActivationGate.Yield();

Show();
try { Show(); }
catch (Exception e)
{
if (!External.UI.ExternalApplication.InvokeCatchException(app, e, null)) throw;
External.UI.ExternalApplication.InvokeReportException(app, e, null);
}
}

internal static async void RunScriptAsync(string script, bool activate)
Expand Down
Loading