using Autodesk.Revit.DB; using Autodesk.Revit.UI.Selection; namespace Szmedi.Toolkit.RvAssists { /// /// 参考选择过滤过滤器 /// public class ReferenceSelectionFilter : ISelectionFilter { private readonly ElementReferenceType referenceType; public ReferenceSelectionFilter(ElementReferenceType referenceType) { this.referenceType = referenceType; } public bool AllowElement(Element elem) { return true; } public bool AllowReference(Reference reference, XYZ position) { return referenceType == reference.ElementReferenceType; } } }