public override string WhereRule()
        {
            string baseErr = base.WhereRule();

            if (HasQuantities.Contains(this))
            {
                baseErr +=
                    "WR21 PhysicalComplexQuantity : The IfcPhysicalComplexQuantity should not reference itself within the list of HasQuantities.\n";
            }
            return(baseErr);
        }
Exemplo n.º 2
0
        public override string GetStepParameters()
        {
            var parameters = new List <string>();

            parameters.Add(Name != null ? Name.ToStepValue() : "$");
            parameters.Add(Description != null ? Description.ToStepValue() : "$");
            parameters.Add(HasQuantities != null ? HasQuantities.ToStepValue() : "$");
            parameters.Add(Discrimination != null ? Discrimination.ToStepValue() : "$");
            parameters.Add(Quality != null ? Quality.ToStepValue() : "$");
            parameters.Add(Usage != null ? Usage.ToStepValue() : "$");

            return(string.Join(", ", parameters.ToArray()));
        }
        /// <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(IfcPhysicalComplexQuantityClause clause)
        {
            var retVal = false;

            try
            {
                switch (clause)
                {
                case IfcPhysicalComplexQuantityClause.WR21:
                    retVal = Functions.SIZEOF(HasQuantities.Where(temp => Object.ReferenceEquals(this, temp))) == 0;
                    break;
                }
            } catch (Exception ex) {
                var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc2x3.QuantityResource.IfcPhysicalComplexQuantity>();
                log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcPhysicalComplexQuantity.{0}' for #{1}.", clause, EntityLabel), ex);
            }
            return(retVal);
        }