
        /// <summary>
        /// OutWavesXYZ
        /// </summary>
        /// <param name="xYZ">XYZ</param>
        public static void OutWaves(XYZ xYZ)
        {
            if (xYZ == null)
            {
                TaskDialog.Show("Error", "XYZ  Is Null！");
                return;
            }
            else
            {
                double x = Math.Round(UnitUtils.Convert(xYZ.X, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                double y = Math.Round(UnitUtils.Convert(xYZ.Y, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                double z = Math.Round(UnitUtils.Convert(xYZ.Z, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                StringBuilder sb = new StringBuilder();
                sb.AppendLine($"XYZ");
                sb.AppendLine();
                sb.AppendLine($"X={x}, Y={y}, Z={z};");
                TaskDialog.Show("Phoenix", sb.ToString());
            }
        }
        /// <summary>
        /// OutWavesXYZS
        /// </summary>
        /// <param name="xYZs">List<XYZ></param>
        public static void OutWaves(List<XYZ> xYZs)
        {
            if (xYZs == null || xYZs.Count == 0)
            {
                TaskDialog.Show("Error", "List<XYZ> Is Null！");
                return;
            }
            else
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine($"XYZS ");
                sb.AppendLine();
                int xYZsCount = xYZs.Count();
                int xyzIndex = 1;
                foreach (XYZ xYZ in xYZs)
                {
                    double x = Math.Round(UnitUtils.Convert(xYZ.X, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                    double y = Math.Round(UnitUtils.Convert(xYZ.Y, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                    double z = Math.Round(UnitUtils.Convert(xYZ.Z, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));

                    sb.AppendLine($"XYZ {xyzIndex}:{xYZsCount} ");
                    sb.AppendLine($"X={x}, Y={y}, Z={z};");
                    sb.AppendLine();
                    xyzIndex++;
                }

                TaskDialog.Show("Phoenix", sb.ToString());
            }
        }
        /// <summary>
        /// OutWavesCurve
        /// </summary>
        /// <param name="line">line</param>
        /// <returns>XYZ</returns>
        public static void OutWaves(Curve curve)
        {
            if (curve != null)
            {
                StringBuilder sb = new StringBuilder();

                XYZ startPoint = curve.Evaluate(0, true);
                double startPointX = Math.Round(UnitUtils.Convert(startPoint.X, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                double startPointY = Math.Round(UnitUtils.Convert(startPoint.Y, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                double startPointZ = Math.Round(UnitUtils.Convert(startPoint.Z, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                XYZ endPoint = curve.Evaluate(1, true);
                double endPointX = Math.Round(UnitUtils.Convert(endPoint.X, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                double endPointY = Math.Round(UnitUtils.Convert(endPoint.Y, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                double endPointZ = Math.Round(UnitUtils.Convert(endPoint.Z, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));

                sb.AppendLine($"Curve");
                sb.AppendLine();
                sb.AppendLine($"Curve_Length:{Math.Round(UnitUtils.Convert(curve.Length, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS))}");
                sb.AppendLine();
                sb.AppendLine($"StartXYZ：X={startPointX}, Y={startPointY}, Z={startPointZ};");
                sb.AppendLine($"End XYZ：X={endPointX}, Y={endPointY}, Z={endPointZ};");
                TaskDialog.Show("Phoenix", sb.ToString());
            }
            else
            {
                TaskDialog.Show("Error", "Curve Is Null！");
                return;
            }
        }
        /// <summary>
        /// OutWavesCurveArray
        /// </summary>
        /// <param name="curves">CurveArray</param>
        public static void OutWaves(CurveArray curveArray)
        {
            if (curveArray.IsEmpty)
            {
                TaskDialog.Show("Error", "CurveArray Is Null！");
            }
            int curveArraySize = curveArray.Size;
            StringBuilder sb = new StringBuilder();
            sb.AppendLine($"CurveArray");
            sb.AppendLine();
            int curveIndex = 1;
            foreach (Curve curve in curveArray)
            {
                XYZ startXYZ = curve.Evaluate(0, true);
                double startXYZX = Math.Round(UnitUtils.Convert(startXYZ.X, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                double startXYZY = Math.Round(UnitUtils.Convert(startXYZ.Y, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                double startXYZZ = Math.Round(UnitUtils.Convert(startXYZ.Z, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                XYZ endXYZ = curve.Evaluate(1, true);
                double endXYZX = Math.Round(UnitUtils.Convert(endXYZ.X, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                double endXYZY = Math.Round(UnitUtils.Convert(endXYZ.Y, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                double endXYZZ = Math.Round(UnitUtils.Convert(endXYZ.Z, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                sb.AppendLine($"CurveArray {curveIndex}:{curveArraySize} Cj Length:{Math.Round(UnitUtils.Convert(curve.Length, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS))}");
                //sb.AppendLine();
                sb.AppendLine($"StartXYZ：X={startXYZX}, Y={startXYZY}, Z={startXYZZ};");
                sb.AppendLine($"End XYZ：X={endXYZX}, Y={endXYZY}, Z={endXYZZ};");
                sb.AppendLine();
                curveIndex++;
            }
            TaskDialog.Show("Phoenix", sb.ToString());
        }
        /// <summary>
        /// OutWavesSring
        /// </summary>
        /// <param name="str"></param>
        public static void OutWaves(string str)
        {
            if (string.IsNullOrEmpty(str))
            {
                TaskDialog.Show("Error", "String Is Null！");
                return;
            }
            else
            {
                TaskDialog.Show("Phoenix", $"String:{str}");
            }
        }
        public static void OutWaves(List<string> strs)
        {

            if (strs.Count == 0)
            {
                TaskDialog.Show("Error", "Strs Is Null！");
                return;
            }
            else
            {
                StringBuilder message = new StringBuilder("Strings:\n");
                foreach (string str in strs)
                {
                    message.AppendLine(str);
                }
                TaskDialog.Show("Phoenix", message.ToString());
            }
        }
        /// <summary>
        /// OutWaves_metricValue
        /// </summary>
        /// <param name="metricValue">inchValue</param>
        public static void OutWaves(Double? metricValue)
        {
            if (metricValue == null)
            {
                TaskDialog.Show("Error", "MetricValue Is Null！");
            }
            TaskDialog.Show("Phoenix", $"Value:{metricValue.Value}");
        }
        /// <summary>
        /// OutWavesId
        /// </summary>
        /// <param name="id">ElementId id</param>
        public static void OutWaves(ElementId id)
        {
            if (id == null)
            {
                TaskDialog.Show("Error", "ElementId Is Null");
            }
            _ = TaskDialog.Show("Phoenix", $"Id:{id.IntegerValue}");
        }
        /// <summary>
        /// OutWavesBool
        /// </summary>
        /// <param name="b">bool</param>
        public static void OutWaves(bool b)
        {
            TaskDialog.Show("Phoenix", "Bool: " + b.ToString());
        }
        /// <summary>
        /// OutWavesEdge
        /// </summary>
        /// <param name="edge">Edge edge</param>
        public static void OutWaves(Edge edge)
        {
            if (edge != null)
            {
                StringBuilder sb = new StringBuilder();
                Curve curve = edge.AsCurve();
                XYZ startXYZ = curve.Evaluate(0, true);
                double startXYZX = Math.Round(UnitUtils.Convert(startXYZ.X, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                double startXYZY = Math.Round(UnitUtils.Convert(startXYZ.Y, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                double startXYZZ = Math.Round(UnitUtils.Convert(startXYZ.Z, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                XYZ sXYZ = new XYZ(startXYZX, startXYZY, startXYZZ);
                XYZ endXYZ = curve.Evaluate(1, true);
                double endXYZX = Math.Round(UnitUtils.Convert(endXYZ.X, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                double endXYZY = Math.Round(UnitUtils.Convert(endXYZ.Y, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                double endXYZZ = Math.Round(UnitUtils.Convert(endXYZ.Z, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
                XYZ eXYZ = new XYZ(endXYZX, endXYZY, endXYZZ);
                Curve tempCurve = Line.CreateBound(sXYZ, eXYZ) as Curve;
                sb.AppendLine($"Edge");
                sb.AppendLine();
                sb.AppendLine($"Edge_Length:{Math.Round(tempCurve.Length)}");
                sb.AppendLine();
                sb.AppendLine($"StartXYZ：X={startXYZX}, Y={startXYZY}, Z={startXYZZ};");
                sb.AppendLine($"End XYZ：X={endXYZX}, Y={endXYZY}, Z={endXYZZ};");
                TaskDialog.Show("Phoenix", sb.ToString());
            }
            else
            {
                TaskDialog.Show("Error", $"Edge Is Null!");
            }
        }
        /// <summary>
        ///  OutWavesEdgeArray
        /// </summary>
        /// <param name="edgeArray">EdgeArray edgeArray</param>
        public static void OutWaves(EdgeArray edgeArray)
        {
            if (edgeArray.IsEmpty)
            {
                TaskDialog.Show("Error:", "EdgeArray Is Null");
            }
            int faceArraySize = edgeArray.Size;
            StringBuilder sb = new StringBuilder();
            int edgeIndex = 1;
            sb.AppendLine($"EdgeArray");
            sb.AppendLine();

            foreach (Edge edge in edgeArray)
            {
                Curve curve = edge.AsCurve();
                XYZ startXYZ = curve.Evaluate(0, true) as XYZ;
                XYZ endXYZ = curve.Evaluate(1, true) as XYZ;
                XYZ sXYZ = new XYZ(
                            Math.Round(UnitUtils.Convert(startXYZ.X, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS)),
                            Math.Round(UnitUtils.Convert(startXYZ.Y, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS)),
                            Math.Round(UnitUtils.Convert(startXYZ.Z, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS)));
                XYZ eXYZ = new XYZ(
                            Math.Round(UnitUtils.Convert(endXYZ.X, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS)),
                            Math.Round(UnitUtils.Convert(endXYZ.Y, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS)),
                            Math.Round(UnitUtils.Convert(endXYZ.Z, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS)));
                sb.AppendLine($"EdgeArray {edgeIndex}:{faceArraySize} Cj Length:{Math.Round(ConvertUnits(curve.Length))}");


                sb.AppendLine($"StartXYZ：X={sXYZ.X}, Y={sXYZ.Y}, Z={sXYZ.Z};");
                sb.AppendLine($"End XYZ：X={eXYZ.X}, Y={eXYZ.Y}, Z={eXYZ.Z};");
                //sb.AppendLine($"Length:{Math.Round(ConvertUnits(curve.Length))}");
                edgeIndex++;
                sb.AppendLine();
            }
            TaskDialog.Show("Phoenix", sb.ToString());
        }
        /// <summary>
        /// OutWavesFface
        /// </summary>
        /// <param name="face">face</param>
        public static void OutWaves(Face face)
        {
            if (face == null)
            {
                TaskDialog.Show("Error:", "Face Is Null!");
            }
            StringBuilder sb = new StringBuilder();
            double area = ConvertAreaUnits(face.Area);
            sb.AppendLine($"Face");
            sb.AppendLine();
            sb.AppendLine($"Face_Area:{area:F2} (m2)");
            sb.AppendLine();
            IList<CurveLoop> curveLoops = face.GetEdgesAsCurveLoops();
            foreach (CurveLoop curveLoop in curveLoops)
            {
                int curveIndex = 1;
                foreach (Curve curve in curveLoop)
                {
                    if (curve.IsBound)
                    {
                        XYZ startXYZ = curve.Evaluate(0, true) as XYZ;
                        XYZ endXYZ = curve.Evaluate(1, true) as XYZ;

                        XYZ sXYZ = new XYZ(
                            Math.Round(UnitUtils.Convert(startXYZ.X, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS)),
                            Math.Round(UnitUtils.Convert(startXYZ.Y, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS)),
                            Math.Round(UnitUtils.Convert(startXYZ.Z, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS))
                        );
                        XYZ eXYZ = new XYZ(
                            Math.Round(UnitUtils.Convert(endXYZ.X, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS)),
                            Math.Round(UnitUtils.Convert(endXYZ.Y, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS)),
                            Math.Round(UnitUtils.Convert(endXYZ.Z, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS))
                        );
                        sb.AppendLine($"FaceEdge {curveIndex} Cj Length:{Math.Round(ConvertUnits(curve.Length))} ");
                        sb.AppendLine($"StartXYZ：X={sXYZ.X}, Y={sXYZ.Y}, Z={sXYZ.Z};");
                        sb.AppendLine($"End XYZ：X={eXYZ.X}, Y={eXYZ.Y}, Z={eXYZ.Z};");
                        //sb.AppendLine($"Length:{Math.Round(ConvertUnits(curve.Length))}");
                        sb.AppendLine();
                        curveIndex++;
                    }
                }
                TaskDialog.Show("Phoenix", sb.ToString());
            }
        }
        /// <summary>
        /// OutWavesFaceArray
        /// </summary>
        /// <param name="faceArray"></param>
        public static void OutWaves(FaceArray faceArray)
        {
            if (faceArray.IsEmpty)
            {
                TaskDialog.Show("Error", "FaceArray Is NuLL!");
            }
            int faceArraySize = faceArray.Size;
            int faceIndex = 1;
            foreach (Face face in faceArray)
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine($"FaceArray");
                sb.AppendLine();
                double area = ConvertAreaUnits(face.Area);

                //sb.AppendLine($"FaceArea: {area:F2} (m2) Cj FaceArray {faceIndex}:{faceArraySize}");
                sb.AppendLine($"FaceArray {faceIndex}:{faceArraySize} Cj FaceArea: {area:F2} (m2)");

                sb.AppendLine();
                IList<CurveLoop> curvesLoop = face.GetEdgesAsCurveLoops();
                int curveIndex = 1;
                foreach (CurveLoop curveLoop in curvesLoop)
                {
                    foreach (Curve curve in curveLoop)
                    {
                        if (curve.IsBound)
                        {
                            XYZ startXYZ = curve.Evaluate(0, true) as XYZ;
                            XYZ endXYZ = curve.Evaluate(1, true) as XYZ;

                            XYZ sXYZ = new XYZ(
                                Math.Round(UnitUtils.Convert(startXYZ.X, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS)),
                                Math.Round(UnitUtils.Convert(startXYZ.Y, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS)),
                                Math.Round(UnitUtils.Convert(startXYZ.Z, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS))
                            );
                            XYZ eXYZ = new XYZ(
                                Math.Round(UnitUtils.Convert(endXYZ.X, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS)),
                                Math.Round(UnitUtils.Convert(endXYZ.Y, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS)),
                                Math.Round(UnitUtils.Convert(endXYZ.Z, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS))
                            );
                            sb.AppendLine($"FaceArrayEdge {faceIndex}.{curveIndex} Cj Length:{Math.Round(ConvertUnits(curve.Length))}");
                            sb.AppendLine($"StartXYZ：X={sXYZ.X}, Y={sXYZ.Y}, Z={sXYZ.Z};");
                            sb.AppendLine($"End XYZ：X={eXYZ.X}, Y={eXYZ.Y}, Z={eXYZ.Z};");
                            //sb.AppendLine($"Length:{Math.Round(ConvertUnits(curve.Length))}");
                            sb.AppendLine();
                        }
                        curveIndex++;
                    }
                }
                faceIndex++;
                TaskDialog.Show("Phoenix", sb.ToString());
            }

        }
        /// <summary>
        /// ConvertValue
        /// </summary>
        /// <param name="inchValue">inchValue</param>
        /// <returns> milliteters</returns>
        public static double ConvertUnits(double value)
        {
            return Math.Round(UnitUtils.Convert(value, DisplayUnitType.DUT_DECIMAL_FEET, DisplayUnitType.DUT_MILLIMETERS));
        }
        /// <summary>
        /// ConvertArea
        /// </summary>
        /// <param name="areaValue">areaValu</param>
        /// <returns>Area</returns>
        public static double ConvertAreaUnits(double areaValue)
        {
            double area = UnitUtils.Convert(areaValue, DisplayUnitType.DUT_SQUARE_FEET, DisplayUnitType.DUT_SQUARE_METERS);
            return Math.Round(area, 3);
        }
        /// <summary>
        /// ConvertVolume
        /// </summary>
        /// <param name="volumeValue">volumeValue</param>
        /// <returns>Volume</returns>
        public static double ConvertVolumeUnits(double volumeValue)
        {
            double volume = UnitUtils.Convert(volumeValue, DisplayUnitType.DUT_CUBIC_FEET, DisplayUnitType.DUT_CUBIC_METERS);
            return Math.Round(volume, 4);
        }