From 20188c3be5e5d04825ca16e94c77d534421d75f8 Mon Sep 17 00:00:00 2001 From: SergeyNefyodov Date: Sun, 14 Jul 2024 15:26:39 +0200 Subject: [PATCH 1/7] Add macro manager support --- .../Core/ComponentModel/DescriptorMap.cs | 2 + .../Descriptors/ApplicationDescriptor.cs | 4 ++ .../Descriptors/DocumentDescriptor.cs | 6 +- .../Descriptors/EnumerableDescriptor.cs | 2 + .../Descriptors/MacroManagerDescriptor.cs | 57 +++++++++++++++++++ source/RevitLookup/RevitLookup.csproj | 1 + 6 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs diff --git a/source/RevitLookup/Core/ComponentModel/DescriptorMap.cs b/source/RevitLookup/Core/ComponentModel/DescriptorMap.cs index 82ce164f..5c9131b6 100644 --- a/source/RevitLookup/Core/ComponentModel/DescriptorMap.cs +++ b/source/RevitLookup/Core/ComponentModel/DescriptorMap.cs @@ -25,6 +25,7 @@ using Autodesk.Revit.DB.Electrical; using Autodesk.Revit.DB.ExtensibleStorage; using Autodesk.Revit.DB.ExternalService; +using Autodesk.Revit.DB.Macros; using Autodesk.Revit.DB.Mechanical; using Autodesk.Revit.DB.Plumbing; using Autodesk.Revit.DB.Visual; @@ -59,6 +60,7 @@ public static Descriptor FindDescriptor(object obj, Type type) //System string value when type is null || type == typeof(string) => new StringDescriptor(value), bool value when type is null || type == typeof(bool) => new BoolDescriptor(value), + MacroManager value when type is null || type == typeof(MacroManager) => new MacroManagerDescriptor(value), IEnumerable value => new EnumerableDescriptor(value), Exception value when type is null || type == typeof(Exception) => new ExceptionDescriptor(value), diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/ApplicationDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/ApplicationDescriptor.cs index d95a0972..49d896f2 100644 --- a/source/RevitLookup/Core/ComponentModel/Descriptors/ApplicationDescriptor.cs +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/ApplicationDescriptor.cs @@ -18,6 +18,7 @@ // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) // (Rights in Technical Data and Computer Software), as applicable. +using Autodesk.Revit.DB.Macros; using RevitLookup.Core.Contracts; using RevitLookup.Core.Objects; @@ -25,14 +26,17 @@ namespace RevitLookup.Core.ComponentModel.Descriptors; public sealed class ApplicationDescriptor : Descriptor, IDescriptorExtension { + private readonly Autodesk.Revit.ApplicationServices.Application _application; public ApplicationDescriptor(Autodesk.Revit.ApplicationServices.Application application) { Name = application.VersionName; + _application = application; } public void RegisterExtensions(IExtensionManager manager) { manager.Register("GetFormulaFunctions", _ => FormulaManager.GetFunctions()); manager.Register("GetFormulaOperators", _ => FormulaManager.GetOperators()); + manager.Register(nameof(MacroManager.GetMacroManager), _ => Variants.Single(MacroManager.GetMacroManager(_application))); } } \ No newline at end of file diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs index ee2d47d9..fd00edb3 100644 --- a/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs @@ -20,11 +20,12 @@ using System.Reflection; using Autodesk.Revit.DB.Lighting; +using Autodesk.Revit.DB.Macros; +using RevitLookup.Core.Contracts; +using RevitLookup.Core.Objects; #if REVIT2023_OR_GREATER using Autodesk.Revit.DB.Structure; #endif -using RevitLookup.Core.Contracts; -using RevitLookup.Core.Objects; namespace RevitLookup.Core.ComponentModel.Descriptors; @@ -80,6 +81,7 @@ public void RegisterExtensions(IExtensionManager manager) { manager.Register(nameof(GlobalParametersManager.GetAllGlobalParameters), GlobalParametersManager.GetAllGlobalParameters); manager.Register(nameof(LightGroupManager.GetLightGroupManager), LightGroupManager.GetLightGroupManager); + manager.Register(nameof(MacroManager.GetMacroManager), MacroManager.GetMacroManager); #if REVIT2022_OR_GREATER manager.Register(nameof(TemporaryGraphicsManager.GetTemporaryGraphicsManager), TemporaryGraphicsManager.GetTemporaryGraphicsManager); #endif diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/EnumerableDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/EnumerableDescriptor.cs index 7f5da11a..d7fc1646 100644 --- a/source/RevitLookup/Core/ComponentModel/Descriptors/EnumerableDescriptor.cs +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/EnumerableDescriptor.cs @@ -21,6 +21,7 @@ using System.Collections; using System.Reflection; using Autodesk.Revit.DB.Electrical; +using Autodesk.Revit.DB.Macros; using RevitLookup.Core.Contracts; using RevitLookup.Core.Objects; @@ -38,6 +39,7 @@ public EnumerableDescriptor(IEnumerable value) IsEmpty = value switch { string => true, + MacroManager enumerable => enumerable.Count == 0, IVariants enumerable => enumerable.Count == 0, ICollection enumerable => enumerable.Count == 0, ParameterSet enumerable => enumerable.IsEmpty, diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs new file mode 100644 index 00000000..99ebde27 --- /dev/null +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs @@ -0,0 +1,57 @@ +// Copyright 2003-2024 by Autodesk, Inc. +// +// Permission to use, copy, modify, and distribute this software in +// object code form for any purpose and without fee is hereby granted, +// provided that the above copyright notice appears in all copies and +// that both that copyright notice and the limited warranty and +// restricted rights notice below appear in all supporting +// documentation. +// +// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. +// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF +// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. +// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE +// UNINTERRUPTED OR ERROR FREE. +// +// Use, duplication, or disclosure by the U.S. Government is subject to +// restrictions set forth in FAR 52.227-19 (Commercial Computer +// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) +// (Rights in Technical Data and Computer Software), as applicable. + +using System.Collections; +using System.Reflection; +using Autodesk.Revit.DB.Macros; +using RevitLookup.Core.Contracts; +using RevitLookup.Core.Objects; + +namespace RevitLookup.Core.ComponentModel.Descriptors; + +public class MacroManagerDescriptor(MacroManager macroManager) : Descriptor, IDescriptorResolver +{ + public Func Resolve(Document context, string target, ParameterInfo[] parameters) + { + return target switch + { + nameof(MacroManager.GetApplicationMacroSecurityOptions) => ResolveApplicationMacroSecurityOptions, + nameof(MacroManager.GetDocumentMacroSecurityOptions) => ResolveDocumentMacroSecurityOptions, + nameof(IEnumerable.GetEnumerator) => ResolveGetEnumerator, + + _ => null + }; + + IVariants ResolveApplicationMacroSecurityOptions() + { + return Variants.Single(MacroManager.GetApplicationMacroSecurityOptions(Context.Application)); + } + + IVariants ResolveDocumentMacroSecurityOptions() + { + return Variants.Single(MacroManager.GetApplicationMacroSecurityOptions(Context.Application)); + } + IVariants ResolveGetEnumerator() + { + using var enumerator = macroManager.GetEnumerator(); + return Variants.Single(enumerator); + } + } +} \ No newline at end of file diff --git a/source/RevitLookup/RevitLookup.csproj b/source/RevitLookup/RevitLookup.csproj index 0e03fe57..63754fa3 100644 --- a/source/RevitLookup/RevitLookup.csproj +++ b/source/RevitLookup/RevitLookup.csproj @@ -50,6 +50,7 @@ + From 5b30526a714bfe76df555986127b9ebeb1ef5f6a Mon Sep 17 00:00:00 2001 From: SergeyNefyodov Date: Sun, 14 Jul 2024 19:03:51 +0200 Subject: [PATCH 2/7] Fix R2025 macro manager bug --- .../ComponentModel/Descriptors/DocumentDescriptor.cs | 6 +++--- .../Descriptors/MacroManagerDescriptor.cs | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs index 561682ec..b42fd66a 100644 --- a/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs @@ -20,14 +20,11 @@ using System.Reflection; using Autodesk.Revit.DB.Lighting; -using Autodesk.Revit.DB.Macros; using RevitLookup.Core.Contracts; using RevitLookup.Core.Objects; #if REVIT2023_OR_GREATER using Autodesk.Revit.DB.Structure; #endif -using RevitLookup.Core.Contracts; -using RevitLookup.Core.Objects; namespace RevitLookup.Core.ComponentModel.Descriptors; @@ -83,7 +80,10 @@ public void RegisterExtensions(IExtensionManager manager) { manager.Register(nameof(GlobalParametersManager.GetAllGlobalParameters), GlobalParametersManager.GetAllGlobalParameters); manager.Register(nameof(LightGroupManager.GetLightGroupManager), LightGroupManager.GetLightGroupManager); +#if REVIT2025_OR_GREATER +#else manager.Register(nameof(MacroManager.GetMacroManager), MacroManager.GetMacroManager); +#endif #if REVIT2022_OR_GREATER manager.Register(nameof(TemporaryGraphicsManager.GetTemporaryGraphicsManager), TemporaryGraphicsManager.GetTemporaryGraphicsManager); #endif diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs index 99ebde27..38f1dc85 100644 --- a/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs @@ -32,8 +32,11 @@ public Func Resolve(Document context, string target, ParameterInfo[] { return target switch { - nameof(MacroManager.GetApplicationMacroSecurityOptions) => ResolveApplicationMacroSecurityOptions, +#if REVIT2025_OR_GREATER +#else nameof(MacroManager.GetDocumentMacroSecurityOptions) => ResolveDocumentMacroSecurityOptions, +#endif + nameof(MacroManager.GetApplicationMacroSecurityOptions) => ResolveApplicationMacroSecurityOptions, nameof(IEnumerable.GetEnumerator) => ResolveGetEnumerator, _ => null @@ -43,11 +46,13 @@ IVariants ResolveApplicationMacroSecurityOptions() { return Variants.Single(MacroManager.GetApplicationMacroSecurityOptions(Context.Application)); } - +#if REVIT2025_OR_GREATER +#else IVariants ResolveDocumentMacroSecurityOptions() { - return Variants.Single(MacroManager.GetApplicationMacroSecurityOptions(Context.Application)); + return Variants.Single(MacroManager.GetDocumentMacroSecurityOptions(Context.Application)); } +#endif IVariants ResolveGetEnumerator() { using var enumerator = macroManager.GetEnumerator(); From b3cdcaf1afcc02fe0dbc71b06e5225cfcb9088b6 Mon Sep 17 00:00:00 2001 From: SergeyNefyodov Date: Sun, 14 Jul 2024 19:05:21 +0200 Subject: [PATCH 3/7] Fix R2025 macro manager bug --- .../Core/ComponentModel/Descriptors/DocumentDescriptor.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs index b42fd66a..7e9d4f17 100644 --- a/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs @@ -25,6 +25,10 @@ #if REVIT2023_OR_GREATER using Autodesk.Revit.DB.Structure; #endif +#if REVIT2025_OR_GREATER +#else +using Autodesk.Revit.DB.Macros; +#endif namespace RevitLookup.Core.ComponentModel.Descriptors; From e2ce81fd4ee7b0bffeb24c5243a19f6d0c84911a Mon Sep 17 00:00:00 2001 From: SergeyNefyodov Date: Mon, 15 Jul 2024 08:42:25 +0200 Subject: [PATCH 4/7] Fix R2025 macro manager bug --- .../Core/ComponentModel/Descriptors/DocumentDescriptor.cs | 6 ++---- .../ComponentModel/Descriptors/MacroManagerDescriptor.cs | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs index 7e9d4f17..091bd843 100644 --- a/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs @@ -25,8 +25,7 @@ #if REVIT2023_OR_GREATER using Autodesk.Revit.DB.Structure; #endif -#if REVIT2025_OR_GREATER -#else +#if !REVIT2025_OR_GREATER using Autodesk.Revit.DB.Macros; #endif @@ -84,8 +83,7 @@ public void RegisterExtensions(IExtensionManager manager) { manager.Register(nameof(GlobalParametersManager.GetAllGlobalParameters), GlobalParametersManager.GetAllGlobalParameters); manager.Register(nameof(LightGroupManager.GetLightGroupManager), LightGroupManager.GetLightGroupManager); -#if REVIT2025_OR_GREATER -#else +#if !REVIT2025_OR_GREATER manager.Register(nameof(MacroManager.GetMacroManager), MacroManager.GetMacroManager); #endif #if REVIT2022_OR_GREATER diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs index 38f1dc85..97c8f3cb 100644 --- a/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs @@ -32,8 +32,7 @@ public Func Resolve(Document context, string target, ParameterInfo[] { return target switch { -#if REVIT2025_OR_GREATER -#else +#if !REVIT2025_OR_GREATER nameof(MacroManager.GetDocumentMacroSecurityOptions) => ResolveDocumentMacroSecurityOptions, #endif nameof(MacroManager.GetApplicationMacroSecurityOptions) => ResolveApplicationMacroSecurityOptions, @@ -46,8 +45,7 @@ IVariants ResolveApplicationMacroSecurityOptions() { return Variants.Single(MacroManager.GetApplicationMacroSecurityOptions(Context.Application)); } -#if REVIT2025_OR_GREATER -#else +#if !REVIT2025_OR_GREATER IVariants ResolveDocumentMacroSecurityOptions() { return Variants.Single(MacroManager.GetDocumentMacroSecurityOptions(Context.Application)); From b215ab7223ca91b77c64045a31fbe423c618de54 Mon Sep 17 00:00:00 2001 From: SergeyNefyodov Date: Mon, 15 Jul 2024 16:25:21 +0200 Subject: [PATCH 5/7] Remove redundant usings --- .../Core/ComponentModel/Descriptors/EnumerableDescriptor.cs | 2 -- .../Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs | 2 -- 2 files changed, 4 deletions(-) diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/EnumerableDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/EnumerableDescriptor.cs index d7fc1646..0602178d 100644 --- a/source/RevitLookup/Core/ComponentModel/Descriptors/EnumerableDescriptor.cs +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/EnumerableDescriptor.cs @@ -22,8 +22,6 @@ using System.Reflection; using Autodesk.Revit.DB.Electrical; using Autodesk.Revit.DB.Macros; -using RevitLookup.Core.Contracts; -using RevitLookup.Core.Objects; namespace RevitLookup.Core.ComponentModel.Descriptors; diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs index 97c8f3cb..e588f2a2 100644 --- a/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs @@ -21,8 +21,6 @@ using System.Collections; using System.Reflection; using Autodesk.Revit.DB.Macros; -using RevitLookup.Core.Contracts; -using RevitLookup.Core.Objects; namespace RevitLookup.Core.ComponentModel.Descriptors; From 4a5ff6ef081b8df25f8cd854d5205361716ebfd8 Mon Sep 17 00:00:00 2001 From: SergeyNefyodov Date: Thu, 18 Jul 2024 17:11:51 +0200 Subject: [PATCH 6/7] Simplify macro manager --- .../RevitLookup/Core/ComponentModel/DescriptorMap.cs | 4 ++-- .../ComponentModel/Descriptors/EnumerableDescriptor.cs | 2 +- .../Descriptors/MacroManagerDescriptor.cs | 10 +--------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/source/RevitLookup/Core/ComponentModel/DescriptorMap.cs b/source/RevitLookup/Core/ComponentModel/DescriptorMap.cs index 20e07565..ecc531cb 100644 --- a/source/RevitLookup/Core/ComponentModel/DescriptorMap.cs +++ b/source/RevitLookup/Core/ComponentModel/DescriptorMap.cs @@ -25,8 +25,8 @@ using Autodesk.Revit.DB.Electrical; using Autodesk.Revit.DB.ExtensibleStorage; using Autodesk.Revit.DB.ExternalService; -using Autodesk.Revit.DB.Macros; using Autodesk.Revit.DB.Lighting; +using Autodesk.Revit.DB.Macros; using Autodesk.Revit.DB.Mechanical; using Autodesk.Revit.DB.Plumbing; using Autodesk.Revit.DB.Visual; @@ -59,7 +59,7 @@ public static Descriptor FindDescriptor(object obj, Type type) //System string value when type is null || type == typeof(string) => new StringDescriptor(value), bool value when type is null || type == typeof(bool) => new BoolDescriptor(value), - MacroManager value when type is null || type == typeof(MacroManager) => new MacroManagerDescriptor(value), + MacroManager when type is null || type == typeof(MacroManager) => new MacroManagerDescriptor(), IEnumerable value => new EnumerableDescriptor(value), Exception value when type is null || type == typeof(Exception) => new ExceptionDescriptor(value), diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/EnumerableDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/EnumerableDescriptor.cs index 0602178d..e6198f3a 100644 --- a/source/RevitLookup/Core/ComponentModel/Descriptors/EnumerableDescriptor.cs +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/EnumerableDescriptor.cs @@ -37,7 +37,6 @@ public EnumerableDescriptor(IEnumerable value) IsEmpty = value switch { string => true, - MacroManager enumerable => enumerable.Count == 0, IVariants enumerable => enumerable.Count == 0, ICollection enumerable => enumerable.Count == 0, ParameterSet enumerable => enumerable.IsEmpty, @@ -59,6 +58,7 @@ public EnumerableDescriptor(IEnumerable value) VoltageTypeSet enumerable => enumerable.IsEmpty, InsulationTypeSet enumerable => enumerable.IsEmpty, TemperatureRatingTypeSet enumerable => enumerable.IsEmpty, + MacroManager enumerable => enumerable.Count == 0, _ => !Enumerator.MoveNext() }; } diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs index e588f2a2..4939ff3b 100644 --- a/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/MacroManagerDescriptor.cs @@ -18,13 +18,12 @@ // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) // (Rights in Technical Data and Computer Software), as applicable. -using System.Collections; using System.Reflection; using Autodesk.Revit.DB.Macros; namespace RevitLookup.Core.ComponentModel.Descriptors; -public class MacroManagerDescriptor(MacroManager macroManager) : Descriptor, IDescriptorResolver +public class MacroManagerDescriptor: Descriptor, IDescriptorResolver { public Func Resolve(Document context, string target, ParameterInfo[] parameters) { @@ -34,8 +33,6 @@ public Func Resolve(Document context, string target, ParameterInfo[] nameof(MacroManager.GetDocumentMacroSecurityOptions) => ResolveDocumentMacroSecurityOptions, #endif nameof(MacroManager.GetApplicationMacroSecurityOptions) => ResolveApplicationMacroSecurityOptions, - nameof(IEnumerable.GetEnumerator) => ResolveGetEnumerator, - _ => null }; @@ -49,10 +46,5 @@ IVariants ResolveDocumentMacroSecurityOptions() return Variants.Single(MacroManager.GetDocumentMacroSecurityOptions(Context.Application)); } #endif - IVariants ResolveGetEnumerator() - { - using var enumerator = macroManager.GetEnumerator(); - return Variants.Single(enumerator); - } } } \ No newline at end of file From 558a89863757db02677359390fa6f811fe0b5a22 Mon Sep 17 00:00:00 2001 From: SergeyNefyodov Date: Thu, 18 Jul 2024 17:13:00 +0200 Subject: [PATCH 7/7] Simplify macro manager --- .../Core/ComponentModel/Descriptors/ApplicationDescriptor.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/ApplicationDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/ApplicationDescriptor.cs index 49d896f2..465b33d7 100644 --- a/source/RevitLookup/Core/ComponentModel/Descriptors/ApplicationDescriptor.cs +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/ApplicationDescriptor.cs @@ -19,8 +19,6 @@ // (Rights in Technical Data and Computer Software), as applicable. using Autodesk.Revit.DB.Macros; -using RevitLookup.Core.Contracts; -using RevitLookup.Core.Objects; namespace RevitLookup.Core.ComponentModel.Descriptors; @@ -37,6 +35,6 @@ public void RegisterExtensions(IExtensionManager manager) { manager.Register("GetFormulaFunctions", _ => FormulaManager.GetFunctions()); manager.Register("GetFormulaOperators", _ => FormulaManager.GetOperators()); - manager.Register(nameof(MacroManager.GetMacroManager), _ => Variants.Single(MacroManager.GetMacroManager(_application))); + manager.Register(nameof(MacroManager.GetMacroManager), _ => MacroManager.GetMacroManager(_application)); } } \ No newline at end of file