12345678910111213141516171819202122232425262728293031323334353637383940 |
- using Autodesk.Revit.DB;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace FWindSoft.Revit
- {
- public class ConnectorSearchOptions
- {
- /// <summary>
- /// 允许元素限定
- /// </summary>
- public Predicate<Element> AllowElement { get; set; }
- /// <summary>
- /// 允许连接件限定
- /// </summary>
- public Predicate<Connector> AllowConnector { get; set; }
- /// <summary>
- /// Connector可用判定
- /// </summary>
- /// <param name="connector"></param>
- /// <returns></returns>
- public bool ConnectorUsable(Connector connector)
- {
- return AllowConnector == null || AllowConnector(connector);
- }
- /// <summary>
- /// 元素可用判定
- /// </summary>
- /// <param name="connector"></param>
- /// <returns></returns>
- public bool ElementUsable(Element element)
- {
- return AllowElement == null || AllowElement(element);
- }
- }
- }
|