Ejemplo n.º 1
0
        private static PointData ConvertToPointData(Face revitFace, FMEPoint fmePoint)
        {
            PointData pointData = null;

            try
            {
                string[] coordinates = fmePoint.Coordinate.Split(',');
                XYZ      xyz         = null;
                if (coordinates.Length == 3)
                {
                    xyz = new XYZ(double.Parse(coordinates[0]), double.Parse(coordinates[1]), double.Parse(coordinates[2]));
                }

                UV uv = null;
                if (null != revitFace && null != xyz)
                {
                    IntersectionResult intersectionResult = revitFace.Project(xyz);
                    if (null != intersectionResult)
                    {
                        uv = intersectionResult.UVPoint;
                    }
                }

                pointData = new PointData(uv, xyz, fmePoint.PointValue);
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
            return(pointData);
        }
Ejemplo n.º 2
0
        private static FMEPoint ConvertToFMEPoint(PointData pointData)
        {
            FMEPoint fmePoint = new FMEPoint();

            try
            {
                XYZ xyz = pointData.XYZPoint;
                fmePoint.Coordinate = Math.Round(xyz.X, 3).ToString() + "," + Math.Round(xyz.Y, 3).ToString() + "," + Math.Round(xyz.Z, 3).ToString();
                fmePoint.PointValue = pointData.PointValue;
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
            return(fmePoint);
        }
Ejemplo n.º 3
0
        public static List <FMEPoint> ConvertToFMEPointList(List <PointData> pointDataList)
        {
            List <FMEPoint> fmePointList = new List <FMEPoint>();

            try
            {
                foreach (PointData ptData in pointDataList)
                {
                    FMEPoint fmePoint = FMEDataUtil.ConvertToFMEPoint(ptData);
                    fmePointList.Add(fmePoint);
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
            }
            return(fmePointList);
        }