Skip to content

Commit

Permalink
Add Family Size Table support to Family Document
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyNefyodov committed May 18, 2024
1 parent a962dc9 commit 31aa432
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
});
}
}

0 comments on commit 31aa432

Please sign in to comment.