qin
2024-09-28 e358beb08f5be49703009b64f058ecfbcfeefbd9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Plumbing;
using System.Collections.Generic;
 
namespace HStation.RevitDev.RevitDataExport.Utility
{
    public static class ConnectorExtense
    {
        public static List<Element> GetConnectorElements(this Connector connector)
        {
            List<Element> ret = new List<Element> ();
            if (connector == null) {  return ret; }
            var refs = connector.AllRefs;
            foreach (Connector reference in refs)
            {
                if (reference.Owner.Id == connector.Owner.Id) { continue; }
 
                var owner = reference.Owner;
                if (owner is PipingSystem ps)
                {
                    continue;
                }
                else
                {
                    ret.Add(owner);
                }
            }
            return ret;
        }
    }
}