public static PartitionSimulationResult ToSAM_PartitionSimulationResult(this TAS3D.Element element)
        {
            if (element == null)
            {
                return(null);
            }

            PartitionSimulationResult result = new PartitionSimulationResult(element.name, Assembly.GetExecutingAssembly().GetName()?.Name, element.GUID);

            result.SetValue("Description", element.description);
            result.SetValue("Ground", element.ground);
            result.SetValue("Ghost", element.ghost);
            result.SetValue("BuildingElementType", ((TBD.BuildingElementType)element.BEType).ToString());
            result.SetValue("Color", Core.Convert.ToColor(element.colour));
            result.SetValue("Internal Shadows", element.internalShadows);
            result.SetValue("Secondary Proportion", element.secondaryProportion);
            result.SetValue("Transparent", element.transparent);
            result.SetValue("Width", element.width);
            result.SetValue("Zone Floor Area", element.zoneFloorArea);
            result.SetValue("Is Used", element.isUsed);
            result.SetValue("Is Preset", element.isPreset);

            if (element.secondaryElement != null)
            {
                result.SetValue("Secondary Element", element.secondaryElement.ToSAM_PartitionSimulationResult());
            }

            return(result);
        }
示例#2
0
        /// <summary>
        /// Gets TAS Building Elements
        /// </summary>
        /// <param name="Building">TAS Building</param>
        /// <returns name="Elements">Building Elements</returns>
        /// <search>
        /// TAS, Builidng, Elements, Get Building Elements, getbuildingelements, elements, GetElements, getelements
        /// </search>
        public static List<Element> Elements(Building Building)
        {
            List<Element> aElementList = new List<Element>();

            int aIndex = 1;
            TAS3D.Element aElement = Building.pBuilding.GetElement(aIndex);
            while (aElement != null)
            {
                aElementList.Add(new Element(aElement));
                aIndex++;
                aElement = Building.pBuilding.GetElement(aIndex);
            }
            return aElementList;
        }
示例#3
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);
        }
示例#4
0
        public static Panel ToSAM(this TAS3D.Element element)
        {
            if (element == null)
            {
                return(null);
            }

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

            PlanarBoundary3D planarBoundary3D = null;

            Panel panel = Analytical.Create.Panel(new Construction(element.name), Query.PanelType(element.BEType), planarBoundary3D);

            panel.Add(parameterSet);

            return(panel);
        }
示例#5
0
        public static Construction Match(this TAS3D.Element element, IEnumerable <Construction> constructions)
        {
            if (constructions == null || element == null)
            {
                return(null);
            }

            string name = Name(element);

            if (string.IsNullOrWhiteSpace(name))
            {
                return(null);
            }

            List <Construction> constructions_Temp = constructions.ToList();

            constructions_Temp.RemoveAll(x => x == null || string.IsNullOrWhiteSpace(x.Name));

            foreach (Construction construction in constructions_Temp)
            {
                if (name.Equals(construction.Name.Trim()))
                {
                    return(construction);
                }
            }

            foreach (Construction construction in constructions_Temp)
            {
                if (name.EndsWith(string.Format(": {0}", construction.Name.Trim())))
                {
                    return(construction);
                }
            }

            return(null);
        }
示例#6
0
文件: Name.cs 项目: HoareLea/SAM_Tas
 public static string Name(this TAS3D.Element element)
 {
     return(Name(element?.name));
 }
示例#7
0
 internal Element(TAS3D.Element Element)
 {
     pElement = Element;
 }