/// <summary> /// Tests the express where-clause specified in param 'clause' /// </summary> /// <param name="clause">The express clause to test</param> /// <returns>true if the clause is satisfied.</returns> public bool ValidateClause(IfcWallClause clause) { var retVal = false; try { switch (clause) { case IfcWallClause.WR1: retVal = Functions.SIZEOF(this /* as IfcObjectDefinition*/.HasAssociations.Where(temp => Functions.TYPEOF(temp).Contains("IFC2X3.IFCRELASSOCIATESMATERIAL"))) <= 1; break; } } catch (Exception ex) { var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc2x3.SharedBldgElements.IfcWall>(); log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcWall.{0}' for #{1}.", clause, EntityLabel), ex); } return(retVal); }
/// <summary> /// Tests the express where-clause specified in param 'clause' /// </summary> /// <param name="clause">The express clause to test</param> /// <returns>true if the clause is satisfied.</returns> public bool ValidateClause(IfcWallClause clause) { var retVal = false; try { switch (clause) { case IfcWallClause.CorrectPredefinedType: retVal = !(Functions.EXISTS(PredefinedType)) || (PredefinedType != IfcWallTypeEnum.USERDEFINED) || ((PredefinedType == IfcWallTypeEnum.USERDEFINED) && Functions.EXISTS(this /* as IfcObject*/.ObjectType)); break; case IfcWallClause.CorrectTypeAssigned: retVal = (Functions.SIZEOF(IsTypedBy) == 0) || (Functions.TYPEOF(this /* as IfcObject*/.IsTypedBy.ItemAt(0).RelatingType).Contains("IFC4.IFCWALLTYPE")); break; } } catch (Exception ex) { var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc4.SharedBldgElements.IfcWall>(); log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcWall.{0}' for #{1}.", clause, EntityLabel), ex); } return(retVal); }