using Autodesk.Revit.DB; using HStation.RevitDev.RevitDataExport.Common; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HStation.RevitDev.RevitDataExport.Utility { internal static class BoundingBoxHelper { public static string BoundingBoxSerialize(this BoundingBoxXYZ bbox) { var box = new Box { min = new Point { x = bbox.Min.X * 304.8 / 1000, y = bbox.Min.Y * 304.8 / 1000, z = bbox.Min.Z * 304.8 / 1000 }, max = new Point { x = bbox.Max.X * 304.8 / 1000, y = bbox.Max.Y * 304.8 / 1000, z = bbox.Max.Z * 304.8 / 1000 } }; var strBox = JsonHelper.ToJson(box); return strBox; } } /// /// "min":{"x":38.66255950927734,"y":62.70765773109019,"z":99.20000457766155},"max":{"x":39.418655395507805,"y":62.87425526329459,"z":101.039993286108}} /// public class Box { public Point min { get; set; } public Point max { get; set; } } public class Point { public double x { get; set; } public double y { get; set; } public double z { get; set; } } }