Example #1
0
        /// <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(IfcObjectClause clause)
        {
            var retVal = false;

            try
            {
                switch (clause)
                {
                case IfcObjectClause.UniquePropertySetNames:
                    retVal = ((Functions.SIZEOF(IsDefinedBy) == 0) || Functions.IfcUniqueDefinitionNames(IsDefinedBy));
                    break;
                }
            } catch (Exception ex) {
                var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc4.Kernel.IfcObject>();
                log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcObject.{0}' for #{1}.", clause, EntityLabel), ex);
            }
            return(retVal);
        }
Example #2
0
        /// <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(IfcObjectClause clause)
        {
            var retVal = false;

            try
            {
                switch (clause)
                {
                case IfcObjectClause.WR1:
                    retVal = Functions.SIZEOF(IsDefinedBy.Where(temp => Functions.TYPEOF(temp).Contains("IFC2X3.IFCRELDEFINESBYTYPE"))) <= 1;
                    break;
                }
            } catch (Exception ex) {
                var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc2x3.Kernel.IfcObject>();
                log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcObject.{0}' for #{1}.", clause, EntityLabel), ex);
            }
            return(retVal);
        }