private void btn_Mus_Click(object sender, RoutedEventArgs e) { CatiaConnection cc = new CatiaConnection(); // Finde Catia Prozess if (cc.CATIALaeuft()) { // Öffne ein neues Part cc.ErzeugePart(); // Generiere ein Profil cc.ErzeugeProfil(Zahnrad1); } else { MessageBoxResult result = MessageBox.Show("Catia Anwendung wurde noch nicht gestartet.\nWollen sie Catia starten?", "Berechnungprogramm für Zahnräder", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No); switch (result) { case MessageBoxResult.Yes: Process Catia = new Process(); Catia.StartInfo.FileName = "CNEXT.exe"; Catia.Start(); break; case MessageBoxResult.No: break; } } }
private void btn_Vis_Click(object sender, RoutedEventArgs e) { try { CatiaConnection cc = new CatiaConnection(); // Finde Catia Prozess if (cc.CATIALaeuft()) { cc.ErzeugePart(); cc.ErstelleLeereSkizze(); cc.ErzeugeProfil(Zahnrad1); } else { MessageBox.Show(""); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Exception aufgetreten"); } Console.WriteLine("Fertig - Taste drücken."); }