样式demo
This commit is contained in:
@@ -9,16 +9,13 @@ namespace ShrlAlgoToolkit.Revit.Assists;
|
||||
public class FuncFilter(Func<Element, bool> allowElement, Func<Reference, XYZ, bool> allowReference = null)
|
||||
: ISelectionFilter
|
||||
{
|
||||
private readonly Func<Element, bool> elementFunc = allowElement;
|
||||
private readonly Func<Reference, XYZ, bool> referenceFunc = allowReference;
|
||||
|
||||
public bool AllowElement(Element elem)
|
||||
{
|
||||
return elementFunc(elem);
|
||||
return allowElement(elem);
|
||||
}
|
||||
|
||||
public bool AllowReference(Reference reference, XYZ position)
|
||||
{
|
||||
return referenceFunc == null || referenceFunc(reference, position);
|
||||
return allowReference == null || allowReference(reference, position);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user