Skip to content

Commit

Permalink
Release 2024.0.6 (#169)
Browse files Browse the repository at this point in the history
* Cleanup

* Update Nuke

* Fix GetMaterialIds

* DefinitionGroup support

* Disable Show for ElementType

* Demo project restore

* Nuke update

* Material area, volume support

* Static members support

* Update Changelog.md

* Update nuget packages

* Update Codeowners

* FamilyInstance rooms support

* Update Changelog.md

* Separate UI thread

* CleanUp

* Remove debug RenderOptions

* Fix initialisation render mode

* Separate thread for UI (#166)

* Separate UI thread

* Remove debug RenderOptions

* Fix initialisation render mode

* Update Build.Installer

* Fix context menu dispatcher

* Icons support

* Icons support (#167)

* Pages virtualization

* Category redirection support

* Rework metadata builder

* Fields, events support

* Fix R24 compability

* Bump version

* Update Contributing.md

* Update Changelog.md

* Update Changelog.md

* Update icon

* Disable transition by default

* Enhanced member support (#168)

* Fields, events support

* Fix R24 compability

* Update icon

* Disable transition by default

* Icons update

* Update Changelog.md
  • Loading branch information
Nice3point authored Jun 1, 2023
1 parent e6ab1ac commit 80ddf15
Show file tree
Hide file tree
Showing 58 changed files with 1,230 additions and 741 deletions.
8 changes: 4 additions & 4 deletions Build/Build.Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ protected override void OnBuildCreated()

VersionMap = new()
{
{"Release R21", "2021.2.5"},
{"Release R22", "2022.2.5"},
{"Release R23", "2023.2.5"},
{"Release R24", "2024.0.5"}
{"Release R21", "2021.2.6"},
{"Release R22", "2022.2.6"},
{"Release R23", "2023.2.6"},
{"Release R24", "2024.0.6"}
};
}
}
9 changes: 5 additions & 4 deletions Build/Build.Installer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Diagnostics.CodeAnalysis;
using Nuke.Common;
using Nuke.Common.Git;
using Nuke.Common.Utilities;
using Serilog;
using Serilog.Events;

Expand All @@ -19,14 +20,14 @@ partial class Build
var exePattern = $"*{installer.Name}.exe";
var exeFile = Directory.EnumerateFiles(installer.Directory, exePattern, SearchOption.AllDirectories).First();

var publishDirectories = Directory.GetDirectories(project.Directory, "Publish*", SearchOption.AllDirectories);
if (publishDirectories.Length == 0) throw new Exception("No files were found to create an installer");
var directories = Directory.GetDirectories(project.Directory, "Publish*", SearchOption.AllDirectories);
if (directories.Length == 0) throw new Exception("No files were found to create an installer");

foreach (var publishDirectory in publishDirectories)
foreach (var directory in directories)
{
var proc = new Process();
proc.StartInfo.FileName = exeFile;
proc.StartInfo.Arguments = $@"""{publishDirectory}""";
proc.StartInfo.Arguments = directory.DoubleQuoteIfNeeded();
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.RedirectStandardError = true;
proc.Start();
Expand Down
48 changes: 47 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,52 @@
# Changelog

# next **2024.0.5**
# 2023-06-01 **2024.0.6**

## Features

### User interface

* Icons

Introducing a collection of new icons for properties, methods, fields, and events, ensuring a visually appealing representation
![image](https://github.com/jeremytammik/RevitLookup/assets/20504884/ffbba475-e240-4928-bf02-68d8f75cbc4c)

* Enhanced Performance with Separate UI Thread

The RevitLookup user interface now operates in a dedicated thread, independent of Revit's workload. This architectural improvement significantly enhances smoothness and responsiveness

* New Additional Setting Options

Introducing a range of new setting options that expand customization capabilities and provide users with greater control over the tool's behavior


### Core

* Class fields

Introducing support for displaying class fields, enabling a comprehensive understanding of the class structure
![image](https://github.com/jeremytammik/RevitLookup/assets/20504884/a4304fd4-4537-4bd2-8d90-88f46137a55a)

* Class events

Introducing support for displaying class events, facilitating better comprehension of event-driven programming within the class
![image](https://github.com/jeremytammik/RevitLookup/assets/20504884/3b7ae347-e7bc-4642-89a0-99cd089f0abe)

* Class private members

Empowering developers with the ability to visualize and access class private fields, properties, methods, and events, providing a complete overview of the class implementation
![image](https://github.com/jeremytammik/RevitLookup/assets/20504884/4c6e4459-cf2f-4d35-9b03-fe0b259b3c9a)

## Improvements

* ElementId Redirection to Category

Implemented a helpful feature that automatically redirects ElementId to Category, whenever applicable. This simplifies navigation and enhances the user experience
* Content Virtualization

Applied content virtualization to the dashboard and settings page, optimizing performance by efficiently managing large amounts of data and dynamically loading content as needed. This results in a smoother and more efficient user interaction

# 2023-05-17 **2024.0.5**

## Features

Expand Down
9 changes: 3 additions & 6 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ public sealed class ParameterDescriptor : Descriptor, IDescriptorExtension
{
public void RegisterExtensions(IExtensionManager manager)
{
manager.Register(nameof(ParameterExtensions.AsBool), _parameter, extension =>
manager.Register(_parameter, extension =>
{
extension.Name = nameof(ParameterExtensions.AsBool);
extension.Result = extension.Value.AsBool();
});
}
Expand All @@ -120,13 +121,9 @@ public sealed class ElementIdDescriptor : Descriptor, IDescriptorRedirection
{
public bool TryRedirect(Document context, string target, out object output)
{
output = null;
if (target == nameof(Element.Id)) return false;

var element = _elementId.ToElement(context);
output = _elementId.ToElement(context);
if (element is null) return false;

output = element;
return true;
}
}
Expand Down
35 changes: 27 additions & 8 deletions RevitLookup/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using System.IO;
using System.Windows.Interop;
using System.Windows.Media;
using Autodesk.Revit.DB.Events;
using System.Windows.Threading;
using Nice3point.Revit.Toolkit.External;
using Nice3point.Revit.Toolkit.External.Handlers;
using RevitLookup.Core;
Expand All @@ -34,6 +34,7 @@ namespace RevitLookup;
[UsedImplicitly]
public class Application : ExternalApplication
{
private static Thread _thread;
public static ActionEventHandler ActionEventHandler { get; private set; }
public static AsyncEventHandler<IReadOnlyCollection<SnoopableObject>> ExternalElementHandler { get; private set; }
public static AsyncEventHandler<IReadOnlyCollection<Descriptor>> ExternalDescriptorHandler { get; private set; }
Expand All @@ -47,6 +48,7 @@ public override async void OnStartup()

var settingsService = Host.GetService<ISettingsService>();
RibbonController.CreatePanel(Application, settingsService);
RunDispatcher();
EnableHardwareRendering(settingsService);
}

Expand Down Expand Up @@ -76,17 +78,34 @@ private static void SaveSettings()
settingsService.Save();
}

private void EnableHardwareRendering(ISettingsService settingsService)
private static void RunDispatcher()
{
_thread = new Thread(Dispatcher.Run);
_thread.SetApartmentState(ApartmentState.STA);
_thread.Start();

//Revit overrides render mode during initialization
//EventHandler is called after initialisation
ActionEventHandler.Raise(_ => RenderOptions.ProcessRenderMode = RenderMode.Default);
}

public static void EnableHardwareRendering(ISettingsService settingsService)
{
if (!settingsService.IsHardwareRenderingAllowed) return;

//Revit overrides render mode during initialization
Application.ControlledApplication.ApplicationInitialized += OnInitialized;
//EventHandler is called after initialisation
ActionEventHandler.Raise(_ => RenderOptions.ProcessRenderMode = RenderMode.Default);
}

void OnInitialized(object sender, ApplicationInitializedEventArgs args)
{
Application.ControlledApplication.ApplicationInitialized -= OnInitialized;
RenderOptions.ProcessRenderMode = RenderMode.Default;
}
public static void DisableHardwareRendering(ISettingsService settingsService)
{
if (settingsService.IsHardwareRenderingAllowed) return;
RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
}

public static void Raise(Action action)
{
Dispatcher.FromThread(_thread)!.Invoke(action);
}
}
9 changes: 6 additions & 3 deletions RevitLookup/Commands/DashboardCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ public class DashboardCommand : ExternalCommand
{
public override void Execute()
{
var window = Host.GetService<IWindow>();
window.ShowAttached();
window.Scope.GetService<INavigationService>().Navigate(typeof(DashboardView));
RevitLookup.Application.Raise(() =>
{
var window = Host.GetService<IWindow>();
window.ShowAttached();
window.Scope.GetService<INavigationService>().Navigate(typeof(DashboardView));
});
}
}
9 changes: 6 additions & 3 deletions RevitLookup/Commands/EventMonitorCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ public class EventMonitorCommand : ExternalCommand
{
public override void Execute()
{
var window = Host.GetService<IWindow>();
window.ShowAttached();
window.Scope.GetService<INavigationService>().Navigate(typeof(EventsView));
RevitLookup.Application.Raise(() =>
{
var window = Host.GetService<IWindow>();
window.ShowAttached();
window.Scope.GetService<INavigationService>().Navigate(typeof(EventsView));
});
}
}
11 changes: 7 additions & 4 deletions RevitLookup/Commands/SearchElementsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ public class SearchElementsCommand : ExternalCommand
{
public override void Execute()
{
var window = Host.GetService<IWindow>();
window.ShowAttached();
window.Scope.GetService<INavigationService>().Navigate(typeof(DashboardView));
window.Scope.GetService<DashboardViewModel>().OpenDialogCommand.Execute("search");
RevitLookup.Application.Raise(() =>
{
var window = Host.GetService<IWindow>();
window.ShowAttached();
window.Scope.GetService<INavigationService>().Navigate(typeof(DashboardView));
window.Scope.GetService<DashboardViewModel>().OpenDialogCommand.Execute("search");
});
}
}
9 changes: 6 additions & 3 deletions RevitLookup/Commands/SnoopDatabaseCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ public class SnoopDatabaseCommand : ExternalCommand
{
public override void Execute()
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.Database);
RevitLookup.Application.Raise(() =>
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.Database);
});
}
}
9 changes: 6 additions & 3 deletions RevitLookup/Commands/SnoopDocumentCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ public class SnoopDocumentCommand : ExternalCommand
{
public override void Execute()
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.Document);
RevitLookup.Application.Raise(() =>
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.Document);
});
}
}
9 changes: 6 additions & 3 deletions RevitLookup/Commands/SnoopEdgeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ public class SnoopEdgeCommand : ExternalCommand
{
public override void Execute()
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.Edge);
RevitLookup.Application.Raise(() =>
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.Edge);
});
}
}
9 changes: 6 additions & 3 deletions RevitLookup/Commands/SnoopFaceCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ public class SnoopFaceCommand : ExternalCommand
{
public override void Execute()
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.Face);
RevitLookup.Application.Raise(() =>
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.Face);
});
}
}
9 changes: 6 additions & 3 deletions RevitLookup/Commands/SnoopLinkedElementCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ public class SnoopLinkedElementCommand : ExternalCommand
{
public override void Execute()
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.LinkedElement);
RevitLookup.Application.Raise(() =>
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.LinkedElement);
});
}
}
9 changes: 6 additions & 3 deletions RevitLookup/Commands/SnoopPointCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ public class SnoopPointCommand : ExternalCommand
{
public override void Execute()
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.Point);
RevitLookup.Application.Raise(() =>
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.Point);
});
}
}
9 changes: 6 additions & 3 deletions RevitLookup/Commands/SnoopSelectionCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ public class SnoopSelectionCommand : ExternalCommand
{
public override void Execute()
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.Selection);
RevitLookup.Application.Raise(() =>
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.Selection);
});
}
}
9 changes: 6 additions & 3 deletions RevitLookup/Commands/SnoopSubElementCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ public class SnoopSubElementCommand : ExternalCommand
{
public override void Execute()
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.SubElement);
RevitLookup.Application.Raise(() =>
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.SubElement);
});
}
}
9 changes: 6 additions & 3 deletions RevitLookup/Commands/SnoopViewCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ public class SnoopViewCommand : ExternalCommand
{
public override void Execute()
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.View);
RevitLookup.Application.Raise(() =>
{
var window = Host.GetService<IWindow>();
window.Initialize();
window.Scope.GetService<ISnoopService>()!.Snoop(SnoopableType.View);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ public CategoryDescriptor(Category category)

public void RegisterExtensions(IExtensionManager manager)
{
manager.Register("GetElements", _category, extension =>
manager.Register(_category, extension =>
{
extension.Name = "GetElements";
extension.Result = extension.Context
#if R23_OR_GREATER
.GetInstances(_category.BuiltInCategory);
Expand Down
Loading

0 comments on commit 80ddf15

Please sign in to comment.