Пример #1
0
        public static List <TAS3D.Zone> Zones(this TAS3D.Building building)
        {
            List <TAS3D.Zone> result = new List <TAS3D.Zone>();

            int index = 1;

            TAS3D.Zone zone = building.GetZone(index);
            while (zone != null)
            {
                result.Add(zone);
                index++;

                zone = building.GetZone(index);
            }

            return(result);
        }
Пример #2
0
        public static List <TAS3D.WindowGroup> WindowGroups(this TAS3D.Building building)
        {
            List <TAS3D.WindowGroup> result = new List <TAS3D.WindowGroup>();

            int index = 1;

            TAS3D.WindowGroup windowGroup = building.GetWindowGroup(index);
            while (windowGroup != null)
            {
                result.Add(windowGroup);
                index++;

                windowGroup = building.GetWindowGroup(index);
            }

            return(result);
        }
Пример #3
0
        public static List <TAS3D.zoneSet> ZoneSets(this TAS3D.Building building)
        {
            List <TAS3D.zoneSet> result = new List <TAS3D.zoneSet>();

            int index = 1;

            TAS3D.zoneSet zoneSet = building.GetZoneSet(index);
            while (zoneSet != null)
            {
                result.Add(zoneSet);
                index++;

                zoneSet = building.GetZoneSet(index);
            }

            return(result);
        }
Пример #4
0
        public static List <TAS3D.ShadeGroup> ShadeGroups(this TAS3D.Building building)
        {
            List <TAS3D.ShadeGroup> result = new List <TAS3D.ShadeGroup>();

            int index = 1;

            TAS3D.ShadeGroup shadeGroup = building.GetShadeGroup(index);
            while (shadeGroup != null)
            {
                result.Add(shadeGroup);
                index++;

                shadeGroup = building.GetShadeGroup(index);
            }

            return(result);
        }
Пример #5
0
        public static List <TAS3D.window> Windows(this TAS3D.Building building)
        {
            List <TAS3D.window> result = new List <TAS3D.window>();

            int index = 1;

            TAS3D.window window = building.GetWindow(index);
            while (window != null)
            {
                result.Add(window);
                index++;

                window = building.GetWindow(index);
            }

            return(result);
        }
Пример #6
0
        public static List <TAS3D.shade> Shades(this TAS3D.Building building)
        {
            List <TAS3D.shade> result = new List <TAS3D.shade>();

            int index = 1;

            TAS3D.shade shade = building.GetShade(index);
            while (shade != null)
            {
                result.Add(shade);
                index++;

                shade = building.GetShade(index);
            }

            return(result);
        }
Пример #7
0
        public static List <Guid> RemoveUnsusedZones(this TAS3D.Building building)
        {
            List <TAS3D.Zone> zones = building?.Zones();

            if (zones == null)
            {
                return(null);
            }

            List <TAS3D.Zone> zones_ToRemove = zones.FindAll(x => x.isUsed == 0);

            List <Guid> guids = zones_ToRemove.ConvertAll(x => new Guid(x.GUID));

            zones_ToRemove.ForEach(x => x.Delete());

            return(guids);
        }
Пример #8
0
        public static List <TAS3D.Element> Elements(this TAS3D.Building building)
        {
            List <TAS3D.Element> result = new List <TAS3D.Element>();

            int index = 1;

            TAS3D.Element element = building.GetElement(index);
            while (element != null)
            {
                result.Add(element);
                index++;

                element = building.GetElement(index);
            }

            return(result);
        }
Пример #9
0
        public static Dictionary <string, TAS3D.Zone> ZoneDictionary(this TAS3D.Building building)
        {
            Dictionary <string, TAS3D.Zone> result = new Dictionary <string, TAS3D.Zone>();

            int index = 1;

            TAS3D.Zone zone = building.GetZone(index);
            while (zone != null)
            {
                string name = zone.name;
                if (name != null)
                {
                    result[name] = zone;
                }

                index++;

                zone = building.GetZone(index);
            }

            return(result);
        }
Пример #10
0
        public static RelationCluster ToSAM(this TAS3D.Building building)
        {
            if (building == null)
            {
                return(null);
            }

            Setting setting = ActiveSetting.Setting;

            Dictionary <string, ISAMObject> dictionary = null;

            RelationCluster result = new RelationCluster();

            dictionary = new Dictionary <string, ISAMObject>();

            List <TAS3D.Zone> zones = Query.Zones(building);

            if (zones != null)
            {
                foreach (TAS3D.Zone zone in zones)
                {
                    Space space = zone.ToSAM();
                    if (space != null)
                    {
                        result.AddObject(space);
                        dictionary[zone.GUID] = space;
                    }
                }
            }

            List <TAS3D.zoneSet> zoneSets = Query.ZoneSets(building);

            if (zoneSets != null)
            {
                foreach (TAS3D.zoneSet zoneSet in zoneSets)
                {
                    List <ISAMObject> sAMObjects = zoneSet?.Zones()?.ConvertAll(x => dictionary[x.GUID]);

                    Group group = new Group(zoneSet.name);
                    group.Add(Create.ParameterSet(setting, zoneSet));

                    result.AddObject(group);
                    sAMObjects?.ForEach(x => result.AddRelation(group, x));
                }
            }

            dictionary = new Dictionary <string, ISAMObject>();

            List <TAS3D.window> windows = Query.Windows(building);

            if (windows != null)
            {
                foreach (TAS3D.window widnow in windows)
                {
                    Aperture aperture = widnow.ToSAM();
                    if (aperture != null)
                    {
                        result.AddObject(aperture);
                    }
                }
            }

            List <TAS3D.Element> elements = Query.Elements(building);

            if (elements != null)
            {
                foreach (TAS3D.Element element in elements)
                {
                    Panel panel = element.ToSAM();
                    if (panel != null)
                    {
                        result.AddObject(panel);
                        dictionary[element.GUID] = panel;
                    }
                }
            }

            List <TAS3D.shade> shades = Query.Shades(building);

            if (shades != null)
            {
                foreach (TAS3D.shade shade in shades)
                {
                    Panel panel = shade.ToSAM();
                    if (panel != null)
                    {
                        result.AddObject(panel);
                    }
                }
            }

            ParameterSet parameterSet = Create.ParameterSet(ActiveSetting.Setting, building);

            result.Add(parameterSet);

            return(result);
        }
Пример #11
0
 internal Building(TAS3D.Building Building)
 {
     pBuilding = Building;
     pName     = pBuilding.name;
     pGUID     = pBuilding.GUID;
 }
Пример #12
0
 internal Building(TAS3D.Building Building)
 {
     pBuilding = Building;
 }