From 31aa432461effbac14cb7afc9480b48a4792f527 Mon Sep 17 00:00:00 2001 From: SergeyNefyodov Date: Sat, 18 May 2024 10:14:53 +0200 Subject: [PATCH 1/2] Add Family Size Table support to Family Document --- .../ComponentModel/Descriptors/DocumentDescriptor.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs index 23e9d8ab..9d7f4c6b 100644 --- a/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs @@ -24,7 +24,7 @@ namespace RevitLookup.Core.ComponentModel.Descriptors; -public sealed class DocumentDescriptor : Descriptor, IDescriptorResolver +public sealed class DocumentDescriptor : Descriptor, IDescriptorResolver, IDescriptorExtension { private readonly Document _document; @@ -71,4 +71,14 @@ IVariants ResolveGetAllUnusedElements() } #endif } + + public void RegisterExtensions(IExtensionManager manager) + { + if (!_document.IsFamilyDocument) return; + manager.Register(nameof(FamilySizeTableManager.GetFamilySizeTableManager), context => + { + var result = FamilySizeTableManager.GetFamilySizeTableManager(_document, new ElementId(BuiltInParameter.RBS_LOOKUP_TABLE_NAME)); + return Variants.Single(result); + }); + } } \ No newline at end of file From 9716585d56b37c21867e7bf9c61756ccb251ca8e Mon Sep 17 00:00:00 2001 From: SergeyNefyodov Date: Sat, 18 May 2024 12:55:21 +0200 Subject: [PATCH 2/2] Add Family Size Table support to Family Document --- .../Core/ComponentModel/Descriptors/DocumentDescriptor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs index 9d7f4c6b..fb024b00 100644 --- a/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs @@ -77,7 +77,7 @@ public void RegisterExtensions(IExtensionManager manager) if (!_document.IsFamilyDocument) return; manager.Register(nameof(FamilySizeTableManager.GetFamilySizeTableManager), context => { - var result = FamilySizeTableManager.GetFamilySizeTableManager(_document, new ElementId(BuiltInParameter.RBS_LOOKUP_TABLE_NAME)); + var result = FamilySizeTableManager.GetFamilySizeTableManager(context, new ElementId(BuiltInParameter.RBS_LOOKUP_TABLE_NAME)); return Variants.Single(result); }); }