Skip to content

Commit

Permalink
Add DocumentCreated event to confirm ActiveAddInId is null inside…
Browse files Browse the repository at this point in the history
… event.
  • Loading branch information
ricaun committed Jan 17, 2025
1 parent c83b817 commit b6ba7ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [1.4.2] / 2025-01-16
### Features
- Add `ApplicationExtensions` to check `InAddInContext` and `InEventContext`.
- Add `DocumentCreated` event to confirm `ActiveAddInId` is null inside event.
### Updates
- Update `Build` copy.

Expand Down
Binary file modified DesignAutomationConsole/Bundle/RevitAddin.DA.Tester.bundle.zip
Binary file not shown.
8 changes: 8 additions & 0 deletions RevitAddin.DA.Tester/Services/DesignAutomationController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ public bool Execute(Application application, string filePath = null, Document do
Console.WriteLine($"Shape Location:\t{typeof(ricaun.Revit.DB.Shape.Colors).Assembly.Location}");
Console.WriteLine("----------------------------------------");

application.DocumentCreated += (s, e) => {
Console.WriteLine($"DocumentCreated:\t{e.Document.Title}");
Console.WriteLine($"DocumentCreated.AddInName: \t{application.ActiveAddInId?.GetAddInName()}");
Console.WriteLine("----------------------------------------");
};

application.NewProjectDocument(UnitSystem.Metric);

return true;
}
}
Expand Down

0 comments on commit b6ba7ae

Please sign in to comment.