/// <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(IfcProcedureClause clause) { var retVal = false; try { switch (clause) { case IfcProcedureClause.WR1: retVal = Functions.SIZEOF(this /* as IfcObjectDefinition*/.Decomposes.Where(temp => !(Functions.TYPEOF(temp).Contains("IFC2X3.IFCRELNESTS")))) == 0; break; case IfcProcedureClause.WR2: retVal = Functions.SIZEOF(this /* as IfcObjectDefinition*/.IsDecomposedBy.Where(temp => !(Functions.TYPEOF(temp).Contains("IFC2X3.IFCRELNESTS")))) == 0; break; case IfcProcedureClause.WR3: retVal = Functions.EXISTS(this /* as IfcRoot*/.Name); break; case IfcProcedureClause.WR4: retVal = (ProcedureType != IfcProcedureTypeEnum.USERDEFINED) || ((ProcedureType == IfcProcedureTypeEnum.USERDEFINED) && Functions.EXISTS(this /* as IfcProcedure*/.UserDefinedProcedureType)); break; } } catch (Exception ex) { var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc2x3.ProcessExtension.IfcProcedure>(); log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcProcedure.{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(IfcProcedureClause clause) { var retVal = false; try { switch (clause) { case IfcProcedureClause.HasName: retVal = Functions.EXISTS(this /* as IfcRoot*/.Name); break; case IfcProcedureClause.CorrectPredefinedType: retVal = !(Functions.EXISTS(PredefinedType)) || (PredefinedType != IfcProcedureTypeEnum.USERDEFINED) || ((PredefinedType == IfcProcedureTypeEnum.USERDEFINED) && Functions.EXISTS(this /* as IfcObject*/.ObjectType)); break; } } catch (Exception ex) { var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc4.ProcessExtension.IfcProcedure>(); log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcProcedure.{0}' for #{1}.", clause, EntityLabel), ex); } return(retVal); }