/// <summary>
        /// Creates and draws a cone that is defined with the given parameters.
        /// </summary>
        /// <param name="document">The active document</param>
        /// <param name="top">The top vertex coordinates of the cone</param>
        /// <param name="bottom">The bottom vertex coordinates of the cone</param>
        /// <param name="top_radius">The radius of the cone at the top</param>
        /// <param name="bottom_radius">The radius of the cone at the bottom</param>
        public void DrawCone(Document document, XYZ top, XYZ bottom, double top_radius, double bottom_radius)
        {
            string     cone_name = "Cone" + m_direct_cone_instance_count++;
            DirectCone cone      = new DirectCone(document, cone_name, top, bottom, top_radius, bottom_radius, S_CONE_COLOR, 50);

            m_direct_shape_list.Add(cone);
        }
Example #2
0
        private void Write(DirectCone dc)
        {
            string length_unit_string = " " + XYZUnitConversionData.LengthUnitStrings[FindSurfaceRevitPlugin.MeasurementUnit];
            string area_unit_string   = " " + XYZUnitConversionData.AreaUnitStrings[FindSurfaceRevitPlugin.MeasurementUnit];
            string volume_unit_string = " " + XYZUnitConversionData.VolumeUnitStrings[FindSurfaceRevitPlugin.MeasurementUnit];

            string content = $"{dc.Name}\n" +
                             $"    .top-center\n" +
                             $"        .X = {dc.Top.X.ToString("##0.####")}\n" +
                             $"        .Y = {dc.Top.Y.ToString("##0.####")}\n" +
                             $"        .Z = {dc.Top.Z.ToString("##0.####")}\n" +
                             $"    .bottom-center\n" +
                             $"        .X = {dc.Bottom.X.ToString("##0.####")}\n" +
                             $"        .Y = {dc.Bottom.Y.ToString("##0.####")}\n" +
                             $"        .Z = {dc.Bottom.Z.ToString("##0.####")}\n" +
                             $"    .center\n" +
                             $"        .X = {dc.Center.X.ToString("##0.####")}\n" +
                             $"        .Y = {dc.Center.Y.ToString("##0.####")}\n" +
                             $"        .Z = {dc.Center.Z.ToString("##0.####")}\n" +
                             $"    .top-radius = {XYZUnitConversionData.FormatLength(dc.TopRadius, FindSurfaceRevitPlugin.MeasurementUnit, "##0.####")}\n" +
                             $"    .bottom-radius = {XYZUnitConversionData.FormatLength(dc.BottomRadius, FindSurfaceRevitPlugin.MeasurementUnit, "##0.####")}\n" +
                             $"    .aperture = {(dc.Aperture*180/Math.PI).ToString("##0.####")+" deg."}\n" +
                             $"    .lateral-area = {XYZUnitConversionData.FormatArea(dc.LateralArea, FindSurfaceRevitPlugin.MeasurementUnit, "##0.####")}\n" +
                             $"    .surface-area = {XYZUnitConversionData.FormatArea(dc.SurfaceArea, FindSurfaceRevitPlugin.MeasurementUnit, "##0.####")}\n" +
                             $"    .volume = {XYZUnitConversionData.FormatVolume(dc.Volume, FindSurfaceRevitPlugin.MeasurementUnit, "##0.####")}\n\n";

            this.richTextBoxInspectResult.AppendText(content);
        }