/// <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(IfcRelAssociatesMaterialClause clause) { var retVal = false; try { switch (clause) { case IfcRelAssociatesMaterialClause.NoVoidElement: retVal = Functions.SIZEOF(this /* as IfcRelAssociates*/.RelatedObjects.Where(temp => (Functions.TYPEOF(temp).Contains("IFC4.IFCFEATUREELEMENTSUBTRACTION")) || (Functions.TYPEOF(temp).Contains("IFC4.IFCVIRTUALELEMENT")))) == 0; break; case IfcRelAssociatesMaterialClause.AllowedElements: retVal = Functions.SIZEOF(this /* as IfcRelAssociates*/.RelatedObjects.Where(temp => (Functions.SIZEOF(Functions.TYPEOF(temp) * Functions.NewTypesArray("IFC4.IFCELEMENT", "IFC4.IFCELEMENTTYPE", "IFC4.IFCWINDOWSTYLE", "IFC4.IFCDOORSTYLE", "IFC4.IFCSTRUCTURALMEMBER", "IFC4.IFCPORT")) == 0))) == 0; break; } } catch (Exception ex) { var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc4.ProductExtension.IfcRelAssociatesMaterial>(); log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcRelAssociatesMaterial.{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(IfcRelAssociatesMaterialClause clause) { var retVal = false; try { switch (clause) { case IfcRelAssociatesMaterialClause.WR21: retVal = Functions.SIZEOF(this /* as IfcRelAssociates*/.RelatedObjects.Where(temp => (Functions.TYPEOF(temp).Contains("IFC2X3.IFCFEATUREELEMENTSUBTRACTION")) || (Functions.TYPEOF(temp).Contains("IFC2X3.IFCVIRTUALELEMENT")))) == 0; break; case IfcRelAssociatesMaterialClause.WR22: retVal = Functions.SIZEOF(this /* as IfcRelAssociates*/.RelatedObjects.Where(temp => (!(Functions.TYPEOF(temp).Contains("IFC2X3.IFCPRODUCT")) && !(Functions.TYPEOF(temp).Contains("IFC2X3.IFCTYPEPRODUCT"))))) == 0; break; } } catch (Exception ex) { var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc2x3.ProductExtension.IfcRelAssociatesMaterial>(); log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcRelAssociatesMaterial.{0}' for #{1}.", clause, EntityLabel), ex); } return(retVal); }