protected override void Process(IFCAnyHandle ifcMaterialLayer) { base.Process(ifcMaterialLayer); IFCAnyHandle ifcMaterial = IFCImportHandleUtil.GetOptionalInstanceAttribute(ifcMaterialLayer, "Material"); if (!IFCAnyHandleUtil.IsNullOrHasNoValue(ifcMaterial)) { Material = IFCMaterial.ProcessIFCMaterial(ifcMaterial); } bool found = false; LayerThickness = IFCImportHandleUtil.GetRequiredScaledLengthAttribute(ifcMaterialLayer, "LayerThickness", out found); if (!found) { return; } // GetOptionalLogicalAttribute defaults to Unknown. We want to default to false here. IsVentilated = IFCImportHandleUtil.GetOptionalLogicalAttribute(ifcMaterialLayer, "IsVentilated", out found); if (!found) { IsVentilated = IFCLogical.False; } }
protected override void Process(IFCAnyHandle ifcSurface) { base.Process(ifcSurface); bool foundUDegree = false; UDegree = IFCImportHandleUtil.GetRequiredIntegerAttribute(ifcSurface, "UDegree", out foundUDegree); if (!foundUDegree) { Importer.TheLog.LogError(ifcSurface.StepId, "Cannot find the UDegree attribute of this surface", true); } bool foundVDegree = false; VDegree = IFCImportHandleUtil.GetRequiredIntegerAttribute(ifcSurface, "VDegree", out foundVDegree); if (!foundVDegree) { Importer.TheLog.LogError(ifcSurface.StepId, "Cannot find the VDegree attribute of this surface", true); } IList <IList <IFCAnyHandle> > controlPoints = IFCImportHandleUtil.GetListOfListOfInstanceAttribute(ifcSurface, "ControlPointsList"); if (controlPoints == null || controlPoints.Count == 0) { Importer.TheLog.LogError(ifcSurface.StepId, "This surface has invalid number of control points", true); } List <IFCAnyHandle> controlPointsTmp = new List <IFCAnyHandle>(); foreach (List <IFCAnyHandle> list in controlPoints) { controlPointsTmp.AddRange(list); } ControlPointsList = IFCPoint.ProcessScaledLengthIFCCartesianPoints(controlPointsTmp); bool foundUClosed = false; UClosed = IFCImportHandleUtil.GetOptionalLogicalAttribute(ifcSurface, "UClosed", out foundUClosed); if (!foundUClosed) { Importer.TheLog.LogWarning(ifcSurface.StepId, "Cannot find the UClosed attribute of this surface, setting to Unknown", true); UClosed = IFCLogical.Unknown; } bool foundVClosed = false; VClosed = IFCImportHandleUtil.GetOptionalLogicalAttribute(ifcSurface, "VClosed", out foundVClosed); if (!foundVClosed) { Importer.TheLog.LogWarning(ifcSurface.StepId, "Cannot find the VClosed attribute of this surface, setting to Unknown", true); VClosed = IFCLogical.Unknown; } }
protected override void Process(IFCAnyHandle ifcCurve) { base.Process(ifcCurve); bool foundDegree = false; Degree = IFCImportHandleUtil.GetRequiredIntegerAttribute(ifcCurve, "Degree", out foundDegree); if (!foundDegree) { Importer.TheLog.LogError(ifcCurve.StepId, "Cannot find the degree of this curve", true); } IList <IFCAnyHandle> controlPoints = IFCAnyHandleUtil.GetAggregateInstanceAttribute <List <IFCAnyHandle> >(ifcCurve, "ControlPointsList"); if (controlPoints == null || controlPoints.Count == 0) { Importer.TheLog.LogError(ifcCurve.StepId, "This curve has invalid number of control points", true); } IList <XYZ> controlPointLists = new List <XYZ>(); foreach (IFCAnyHandle point in controlPoints) { XYZ pointXYZ = IFCPoint.ProcessScaledLengthIFCCartesianPoint(point); controlPointLists.Add(pointXYZ); } ControlPointsList = controlPointLists; bool foundClosedCurve = false; IFCLogical closedCurve = IFCImportHandleUtil.GetOptionalLogicalAttribute(ifcCurve, "ClosedCurve", out foundClosedCurve); if (!foundClosedCurve) { Importer.TheLog.LogWarning(ifcCurve.StepId, "Cannot find the ClosedCurve property of this curve, ignoring", false); ClosedCurve = null; } else { ClosedCurve = (closedCurve == IFCLogical.True); } }