private bool IsContinuedMaterialRow(COBieAssemblyRow row) { if (ValidateString(row.Name)) { if (row.Name.Contains(" : continued "))//our flag for a continued assembly child list { return(true); } if (ValidateString(row.ChildNames)) { string name = row.Name.ToLower().Trim(); string lastname = LastRow.Name.ToLower().Trim(); lastname = RemPostFixNumber(lastname); if (name.Contains(lastname)) { //test to see if ChildName row as a whole text finds a material, if so then a sing material on the row, so assume the material layer set is listed per row, and not in the ChildName field as a delimited string string test = row.ChildNames.ToLower().Trim(); IfcMaterialLayer ifcMaterialLayer = IfcMaterialLayers.Where(ml => (ml.Material.Name != null) && (ml.Material.Name.ToString().ToLower().Trim() == test)).FirstOrDefault(); if (ifcMaterialLayer != null) { return(true); } } } } return(false); }
/// <summary> /// Add the child objects to the IfcMaterialLayerSet /// </summary> /// <param name="ifcMaterialLayerSet">IfcMaterialLayerSet object</param> /// <param name="childNames">list of child object names separated by " : ", NOT case sensitive</param> private bool AddChildObjects(IfcMaterialLayerSet ifcMaterialLayerSet, string childNames) { bool returnValue = false; List <string> splitChildNames = SplitString(childNames, ':'); foreach (string item in splitChildNames) { string name = item; double?thickness = GetLayerThickness(name); name = GetMaterialName(name).ToLower().Trim(); IfcMaterialLayer ifcMaterialLayer = null; IEnumerable <IfcMaterialLayer> ifcMaterialLayers = IfcMaterialLayers.Where(ml => (ml.Material.Name != null) && (ml.Material.Name.ToString().ToLower().Trim() == name)); if ((ifcMaterialLayers.Any()) && (ifcMaterialLayers.Count() > 1) && (thickness != null) ) { ifcMaterialLayer = ifcMaterialLayers.Where(ml => ml.LayerThickness == thickness).FirstOrDefault(); } else { ifcMaterialLayer = ifcMaterialLayers.FirstOrDefault(); } if (ifcMaterialLayer != null) { if (!ifcMaterialLayerSet.MaterialLayers.Contains(ifcMaterialLayer)) { ifcMaterialLayerSet.MaterialLayers.Add(ifcMaterialLayer); } returnValue = true; } } return(returnValue); }