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); } }
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); } }
/// <summary> /// Get the styled item corresponding to the solid inside of an IFCRepresentationItem. /// </summary> /// <param name="repItem">The representation item.</param> /// <returns>The corresponding IFCStyledItem, or null if not found.</returns> /// <remarks>This function is intended to work on an IFCBooleanResult with an arbitrary number of embedded /// clipping operations. We will take the first StyledItem that corresponds to either an IFCBooleanResult, /// or the contained solid. We explicitly do not want any material associated specifically with the void.</remarks> private IFCStyledItem GetStyledItemFromOperand(IFCRepresentationItem repItem) { if (repItem == null) { return(null); } if (repItem.StyledByItem != null) { return(repItem.StyledByItem); } if (repItem is IFCBooleanResult) { IIFCBooleanOperand firstOperand = (repItem as IFCBooleanResult).FirstOperand; if (firstOperand is IFCRepresentationItem) { return(GetStyledItemFromOperand(firstOperand as IFCRepresentationItem)); } } return(null); }
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); } }
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); } }