/// <summary> /// Get the property value where the property name equals the passed in value. /// Always use SetAllPropertySingleValues before calling this method /// </summary> /// <param name="PropertyValueName">IfcPropertySingleValue name</param> /// <param name="containsString">Do Contains text match on PropertyValueName if true, exact match if false</param> /// <returns></returns> public string GetPropertySingleValueValue(string PropertyValueName, bool containsString) { IfcPropertySingleValue ifcPropertySingleValue = null; if (containsString) { ifcPropertySingleValue = ObjProperties.OfType <IfcPropertySingleValue>().Where(p => p.Name.ToString().Contains(PropertyValueName)).FirstOrDefault(); } else { ifcPropertySingleValue = ObjProperties.OfType <IfcPropertySingleValue>().Where(p => p.Name == PropertyValueName).FirstOrDefault(); } //return a string value if ((ifcPropertySingleValue != null) && (ifcPropertySingleValue.NominalValue != null) && (!string.IsNullOrEmpty(ifcPropertySingleValue.NominalValue.Value.ToString())) && (ifcPropertySingleValue.Name.ToString() != ifcPropertySingleValue.NominalValue.Value.ToString()) //name and value are not the same ) { return(ifcPropertySingleValue.NominalValue.Value.ToString()); } else { return(Constants.DEFAULT_STRING); } }
/// <summary> /// Get the property value where the property name equals the passed in value /// Always use SetAllPropertySingleValues before calling this method /// </summary> /// <param name="PropertyValueName"></param> /// <returns></returns> public IfcPropertySingleValue GetPropertySingleValue(string PropertyValueName) { return(ObjProperties.OfType <IfcPropertySingleValue>().Where(p => p.Name == PropertyValueName).FirstOrDefault()); }