diff --git a/source/RevitLookup/Core/ComponentModel/Descriptors/FamilyManagerDescriptor.cs b/source/RevitLookup/Core/ComponentModel/Descriptors/FamilyManagerDescriptor.cs index ca34f39c..2d7b48f3 100644 --- a/source/RevitLookup/Core/ComponentModel/Descriptors/FamilyManagerDescriptor.cs +++ b/source/RevitLookup/Core/ComponentModel/Descriptors/FamilyManagerDescriptor.cs @@ -31,6 +31,8 @@ public Func Resolve(Document context, string target, ParameterInfo[] return target switch { nameof(FamilyManager.GetAssociatedFamilyParameter) => ResolveGetAssociatedFamilyParameter, + nameof(FamilyManager.IsParameterLockable) => ResolveIsParameterLockable, + nameof(FamilyManager.IsParameterLocked) => ResolveIsParameterLocked, _ => null }; @@ -41,7 +43,7 @@ IVariants ResolveGetAssociatedFamilyParameter() var elements = elementTypes .UnionWith(elementInstances) .ToElements(); - + var resolveSet = new Variants>(elements.Count); foreach (var element in elements) { @@ -54,7 +56,33 @@ IVariants ResolveGetAssociatedFamilyParameter() } } } - + + return resolveSet; + } + + IVariants ResolveIsParameterLockable() + { + var familyParameters = familyManager.Parameters; + var resolveSet = new Variants(familyParameters.Size); + foreach (FamilyParameter parameter in familyParameters) + { + var result = familyManager.IsParameterLockable(parameter); + resolveSet.Add(result, $"{parameter.Definition.Name}: {result}"); + } + + return resolveSet; + } + + IVariants ResolveIsParameterLocked() + { + var familyParameters = familyManager.Parameters; + var resolveSet = new Variants(familyParameters.Size); + foreach (FamilyParameter parameter in familyParameters) + { + var result = familyManager.IsParameterLocked(parameter); + resolveSet.Add(result, $"{parameter.Definition.Name}: {result}"); + } + return resolveSet; } }