///<summary> This gets called when when the user runs this command.</summary> protected override Result RunCommand(Rhino.RhinoDoc doc, RunMode mode) { Pach_Absorption_Designer PAD = new Pach_Absorption_Designer(); PAD.Show(); return(Result.Success); }
private void Abs_Designer_Click(object sender, EventArgs e) { Pach_Absorption_Designer AD = new Pach_Absorption_Designer(); AD.ShowDialog(); switch (AD.Result) { case Pach_Absorption_Designer.AbsorptionModelResult.Random_Incidence: //Assign Random Incidence Absorption Coefficients... Material_Mode(true); Abs63Out.Value = (int)(AD.RI_Absorption[0] * 100); Abs125Out.Value = (int)(AD.RI_Absorption[1] * 100); Abs250Out.Value = (int)(AD.RI_Absorption[2] * 100); Abs500Out.Value = (int)(AD.RI_Absorption[3] * 100); Abs1kOut.Value = (int)(AD.RI_Absorption[4] * 100); Abs2kOut.Value = (int)(AD.RI_Absorption[5] * 100); Abs4kOut.Value = (int)(AD.RI_Absorption[6] * 100); Abs8kOut.Value = (int)(AD.RI_Absorption[7] * 100); UpdateForm(); int layer_index = Rhino.RhinoDoc.ActiveDoc.Layers.Find(LayerDisplay.Text, true); Rhino.DocObjects.Layer layer = Rhino.RhinoDoc.ActiveDoc.Layers[layer_index]; layer.SetUserString("ABSType", "Coefficients"); Commit_Layer_Acoustics(); Material_Mode(true); return; case Pach_Absorption_Designer.AbsorptionModelResult.Smart_Material: //Store and Assign Smart Material. Material_Mode(false); Commit_SmartMaterial(AD); //Commit_Layer_Acoustics(); return; default: return; //Do nothing } }
private void Commit_SmartMaterial(Pach_Absorption_Designer AD) { int layer_index = Rhino.RhinoDoc.ActiveDoc.Layers.Find(LayerDisplay.Text, true); Rhino.DocObjects.Layer layer = Rhino.RhinoDoc.ActiveDoc.Layers[layer_index]; if (AD.Is_Finite) { layer.SetUserString("ABSType", "Buildup_Finite"); } else { layer.SetUserString("ABSType", "Buildup"); } string Buildup = ""; List<AbsorptionModels.ABS_Layer> Layers = AD.Material_Layers(); foreach (AbsorptionModels.ABS_Layer Layer in Layers) Buildup += Layer.LayerCode(); layer.SetUserString("BuildUp", Buildup); SmartMat_Display.Series.Clear(); Material_Mode(false); for (int i = 0; i < AD.Polar_Plot().Series.Count; i++) this.SmartMat_Display.Series.Add(AD.Polar_Plot().Series[i]); }
///<summary> This gets called when when the user runs this command.</summary> protected override Result RunCommand(Rhino.RhinoDoc doc, RunMode mode) { Pach_Absorption_Designer PAD = new Pach_Absorption_Designer(); PAD.Show(); return Result.Success; }