Exemplo n.º 1
0
        override protected void Process(IFCAnyHandle item)
        {
            base.Process(item);

            IFCBooleanOperator?booleanOperator = IFCEnums.GetSafeEnumerationAttribute <IFCBooleanOperator>(item, "Operator");

            if (booleanOperator.HasValue)
            {
                BooleanOperator = booleanOperator.Value;
            }

            IFCAnyHandle firstOperand = IFCImportHandleUtil.GetRequiredInstanceAttribute(item, "FirstOperand", true);

            FirstOperand = IFCBooleanOperand.ProcessIFCBooleanOperand(firstOperand);

            IFCAnyHandle secondOperand = IFCImportHandleUtil.GetRequiredInstanceAttribute(item, "SecondOperand", true);


            // We'll allow a solid to be created even if the second operand can't be properly handled.
            try
            {
                SecondOperand = IFCBooleanOperand.ProcessIFCBooleanOperand(secondOperand);
            }
            catch (Exception ex)
            {
                SecondOperand = null;
                Importer.TheLog.LogError(secondOperand.StepId, ex.Message, false);
            }
        }
Exemplo n.º 2
0
        override protected void Process(IFCAnyHandle item)
        {
            base.Process(item);

            string booleanOperatorAsString = IFCAnyHandleUtil.GetEnumerationAttribute(item, "Operator");

            if (!string.IsNullOrWhiteSpace(booleanOperatorAsString))
            {
                BooleanOperator = (IFCBooleanOperator)Enum.Parse(typeof(IFCBooleanOperator), booleanOperatorAsString, true);
            }

            IFCAnyHandle firstOperand = IFCImportHandleUtil.GetRequiredInstanceAttribute(item, "FirstOperand", true);

            FirstOperand = IFCBooleanOperand.ProcessIFCBooleanOperand(firstOperand);

            IFCAnyHandle secondOperand = IFCImportHandleUtil.GetRequiredInstanceAttribute(item, "SecondOperand", true);


            // We'll allow a solid to be created even if the second operand can't be properly handled.
            try
            {
                SecondOperand = IFCBooleanOperand.ProcessIFCBooleanOperand(secondOperand);
            }
            catch (Exception ex)
            {
                SecondOperand = null;
                IFCImportFile.TheLog.LogError(secondOperand.StepId, ex.Message, false);
            }
        }