private void btn_OK_Click(object sender, EventArgs e) { if (cb_solids.CheckedItems.Count == 0) { return; } if (cb_export_as.SelectedItem == null) { MessageDisplay.ShowError( LanguageSupport.Translate("You have to select whether to export selected solids as clamps or design.")); return; } if (cb_attach_to.SelectedItem == null) { MessageDisplay.ShowError( LanguageSupport.Translate("You have to select attach component.")); return; } selected_solids = new List <string>(); for (int i = 0; i < cb_solids.CheckedItems.Count; i++) { selected_solids.Add(cb_solids.CheckedItems[i].ToString()); } attach_to = cb_attach_to.SelectedItem.ToString(); export_as_clamp = (cb_export_as.SelectedIndex == 0); fm_doc = null; this.Close(); }
public MultiSolidSelectionDlg(List <SolidInfo> all_solids, FeatureCAM.FMDocument doc, List <string> attach_components) { FeatureCAM.FMSolid fm_solid; if (all_solids == null || attach_components == null) { this.Close(); return; } fm_doc = doc; InitializeComponent(); this.cb_solids.Items.Clear(); foreach (SolidInfo solid in all_solids) { fm_solid = (FeatureCAM.FMSolid)doc.Solids.Item(solid.name); if (fm_solid != null) { this.cb_solids.Items.Add(solid.name, fm_solid.Selected); } } this.cb_attach_to.Items.Clear(); foreach (string component in attach_components) { this.cb_attach_to.Items.Add(component); } }