Skip to content

Commit

Permalink
Add ApplicationInitialized event to test.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricaun committed Sep 18, 2024
1 parent 2b0c820 commit d8491f1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Create `Revit.DesignApplication` with `DesignApplication` to load correct version of Revit.
### Updates
- Use `DesignApplication` to load correct version of Revit.
- Add `ApplicationInitialized` event to test.

## [1.4.0] / 2025-08-27
### Features
Expand Down
Binary file modified DesignAutomationConsole/Bundle/RevitAddin.DA.Tester.bundle.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions DesignAutomationConsole/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ private static async Task DA_RevitAddin_DA_Tester()
//"2019",
//"2020",
//"2021",
//"2022",
"2022",
//"2023",
//"2024",
"2025",
//"2025",
},
EnableConsoleLogger = true,
//EnableParameterConsoleLogger = true,
Expand Down
8 changes: 8 additions & 0 deletions RevitAddin.DA.Tester/Revit/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace RevitAddin.DA.Tester.Revit
{
public class App : DesignApplication
{
public static string AddInName { get; set; } = "none";
public override void OnStartup()
{
Console.WriteLine("----------------------------------------");
Expand All @@ -17,6 +18,13 @@ public override void OnStartup()
Console.WriteLine("----------------------------------------");
Console.WriteLine($"AddInName: \t{Application.ActiveAddInId?.GetAddInName()}");
Console.WriteLine("----------------------------------------");
Application.ApplicationInitialized += Application_ApplicationInitialized;
}

private void Application_ApplicationInitialized(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e)
{
var application = (Application)sender;
AddInName = application.ActiveAddInId?.GetAddInName();
}

public override void OnShutdown()
Expand Down
2 changes: 1 addition & 1 deletion RevitAddin.DA.Tester/RevitAddin.DA.Tester.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

<PropertyGroup>
<PackageId>RevitAddin.DA.Tester</PackageId>
<Version>1.4.1-alpha</Version>
<Version>1.4.1-beta</Version>
<ProjectGuid>{7C324916-9F8D-43B0-B226-DA67D2504393}</ProjectGuid>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public bool Execute(Application application, string filePath = null, Document do
}

Console.WriteLine($"UI:\t{UI.IsValid()}");
Console.WriteLine($"App.AddInName:\t{App.AddInName}");
Console.WriteLine("----------------------------------------");
Console.WriteLine($"Shape:\t{typeof(ricaun.Revit.DB.Shape.Colors).Assembly}");
Console.WriteLine($"Shape Location:\t{typeof(ricaun.Revit.DB.Shape.Colors).Assembly.Location}");
Expand Down

0 comments on commit d8491f1

Please sign in to comment.