protected override void Process(IFCAnyHandle ifcCurve) { base.Process(ifcCurve); IList <IFCAnyHandle> points = IFCAnyHandleUtil.GetAggregateInstanceAttribute <List <IFCAnyHandle> >(ifcCurve, "Points"); int numPoints = points.Count; if (numPoints < 2) { string msg = "IfcPolyLine had " + numPoints + ", expected at least 2, ignoring"; Importer.TheLog.LogError(Id, msg, false); return; } IList <XYZ> pointXYZs = new List <XYZ>(); foreach (IFCAnyHandle point in points) { XYZ pointXYZ = IFCPoint.ProcessScaledLengthIFCCartesianPoint(point); pointXYZs.Add(pointXYZ); } if (pointXYZs.Count != numPoints) { Importer.TheLog.LogError(Id, "Some of the IFC points cannot be converted to Revit points", true); } CurveLoop = IFCGeometryUtil.CreatePolyCurveLoop(pointXYZs, points, Id, false); Curve = IFCGeometryUtil.CreateCurveFromPolyCurveLoop(CurveLoop, pointXYZs); }
/// <summary> /// Set the representation of the curve based on one CurveLoop. /// </summary> /// <param name="curveLoop">The one CurveLoop.</param> /// <param name="pointXYZs">The point list that created this CurveLoop.</param> /// <remarks>The point list is used to potentially collapse a series of /// line segments into one.</remarks> public void SetCurveLoop(CurveLoop curveLoop, IList <XYZ> pointXYZs) { SetCurveLoop(curveLoop); if (Curve == null) { Curve = IFCGeometryUtil.CreateCurveFromPolyCurveLoop(GetTheCurveLoop(), pointXYZs); } }
protected override void Process(IFCAnyHandle ifcCurve) { base.Process(ifcCurve); IFCAnyHandle points = IFCAnyHandleUtil.GetInstanceAttribute(ifcCurve, "Points"); if (IFCAnyHandleUtil.IsNullOrHasNoValue(points)) { Importer.TheLog.LogMissingRequiredAttributeError(ifcCurve, "Points", true); return; } IFCCartesianPointList pointList = IFCCartesianPointList.ProcessIFCCartesianPointList(points); IList <XYZ> pointXYZs = pointList.CoordList; int numPoints = pointXYZs.Count; CurveLoop = IFCGeometryUtil.CreatePolyCurveLoop(pointXYZs, null, Id, false); Curve = IFCGeometryUtil.CreateCurveFromPolyCurveLoop(CurveLoop, pointXYZs); }