/// <summary> /// Creates and draws a sphere that is defined with the given parameters. /// </summary> /// <param name="document">The active document</param> /// <param name="center">The center coordinates of the sphere</param> /// <param name="radius">The radius of the sphere</param> public void DrawSphere(Document document, XYZ center, double radius) { string sphere_name = "Sphere" + m_direct_sphere_instance_count++; DirectSphere sphere = new DirectSphere(document, sphere_name, center, radius, S_SPHERE_COLOR, 50); m_direct_shape_list.Add(sphere); }
private void Write(DirectSphere ds) { string content = $"{ds.Name}\n" + $" .center\n" + $" .X = {ds.Center.X.ToString("##0.####")}\n" + $" .Y = {ds.Center.Y.ToString("##0.####")}\n" + $" .Z = {ds.Center.Z.ToString("##0.####")}\n" + $" .radius = {XYZUnitConversionData.FormatLength(ds.Radius, FindSurfaceRevitPlugin.MeasurementUnit, "##0.####")}\n" + $" .surface-area = {XYZUnitConversionData.FormatArea(ds.SurfaceArea, FindSurfaceRevitPlugin.MeasurementUnit, "##0.####")}\n" + $" .volume = {XYZUnitConversionData.FormatVolume(ds.Volume, FindSurfaceRevitPlugin.MeasurementUnit, "##0.####")}\n\n"; this.richTextBoxInspectResult.AppendText(content); }