| | |  | Gut zu wissen: Hilfreiche Tipps und Tricks aus der Praxis prägnant, und auf den Punkt gebracht für EPLAN | | | |  | Einladung zum Schaltschrank-Festival: Noch mehr Power im Schaltschrankbau, eine Pressemitteilung
|
|
Autor
|
Thema: Automati8siert bearbeiten (2012 mal gelesen)
|
Sbg Markus Mitglied
  
 Beiträge: 516 Registriert: 24.11.2009 Eplan P8 2.7 Eplan P8 2.5 Eplan P8 2.3 Eplan P8 2.2 Eplan P8 2.0 Eplan 5.70.4.26200
|
erstellt am: 26. Mai. 2015 11:19 <-- editieren / zitieren --> Unities abgeben:         
Kann ich bei diesen Skript einen Befehl einbauen, der das Projekt sauber schließt. public class Script { [Start] public bool AutoTreat(String strProjectName, String strSettingsFolder, Int32 nImportSettings, Int32 nCompleteProject, String strSelectionFilter) { Progress progress = new Progress("SimpleProgress"); progress.SetAllowCancel(true); bool bResult = true; int nActionsPercent = 100; if (nCompleteProject == 0 && nImportSettings == 1) { progress.BeginPart(10, "ReadSelectionSettings"); nActionsPercent -= 10; Eplan.EplApi.Base.Settings xmlSettings = new Eplan.EplApi.Base.Settings(); xmlSettings.ReadSettings(strSettingsFolder + @"\Selection.xml"); progress.EndPart(); } progress.BeginPart(nActionsPercent,""); nActionsPercent = 100; if(!progress.Canceled()) { if (nImportSettings == 1) { progress.BeginPart(25, "ReadSettings"); nActionsPercent -= 25; Eplan.EplApi.Base.Settings xmlSettings = new Eplan.EplApi.Base.Settings(); xmlSettings.ReadSettings(strSettingsFolder + @"\Settings1.xml"); progress.EndPart(); } } if(!progress.Canceled()) { progress.BeginPart(nActionsPercent, "label"); ActionCallingContext context1 = new ActionCallingContext (); context1.AddParameter("configscheme","BMK Ausgabe"); context1.AddParameter("filterscheme",""); context1.AddParameter("sortscheme",""); context1.AddParameter("language","de_DE"); context1.AddParameter("destinationfile",@"$(PROJECTPATH)\Bauteil.prn"); context1.AddParameter("recrepeat","1"); context1.AddParameter("taskrepeat","1"); context1.AddParameter("showoutput","1"); context1.AddParameter("ProjectName",strProjectName); if (nCompleteProject == 1) { context1.AddParameter("type","PROJECT"); } else { context1.AddParameter("type","PAGES"); context1.AddParameter("PAGEFILTERNAME", strSelectionFilter); } bResult &= new CommandLineInterpreter().Execute("label",context1); progress.EndPart(); } progress.EndPart(true); return bResult; } } ------------------ --------------- mfg Markus Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
F.S. Moderator
    
 Beiträge: 1896 Registriert: 23.04.2003 EPLAN Electric P8 2024 Prof.
|
erstellt am: 27. Mai. 2015 10:37 <-- editieren / zitieren --> Unities abgeben:          Nur für Sbg Markus
Hallo Markus, Projekt schließen geht so:
Code:
//Aktuelles Projekt schließen ActionCallingContext ProjektContext = new ActionCallingContext(); ProjektContext.AddParameter("NOCLOSE", "0"); CommandLineInterpreter CommandLineInterpreter = new CommandLineInterpreter(); CommandLineInterpreter.Execute("XPrjActionProjectClose", ProjektContext);
Müßte dann am Ende vor der Zeile
Code: return bResult;
eingefügt werden. ------------------ grüße FrankS Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
Sbg Markus Mitglied
  
 Beiträge: 516 Registriert: 24.11.2009 Eplan P8 2.7 Eplan P8 2.5 Eplan P8 2.3 Eplan P8 2.2 Eplan P8 2.0 Eplan 5.70.4.26200
|
erstellt am: 29. Mai. 2015 10:34 <-- editieren / zitieren --> Unities abgeben:         
Wo füge ich diese Zeilen in diesen Skript ein ? public class Script { [Start] public void AutoTreat() { Progress progress = new Progress("SimpleProgress"); progress.BeginPart(100,""); progress.SetAllowCancel(true); if(!progress.Canceled()) { System.Diagnostics.Process.Start(@"g:\EPLAN\Zusatz_Programme\BAT_Dateien\AB-AV\Schilder BMK.bat"); progress.EndPart(); } progress.EndPart(true); } } ------------------ --------------- mfg Markus Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |

| | Elektrotechniker (m/w/d) in der Projektierung | Turck ist globaler Partner für die Fabrik-, Prozess- und Logistikautomation in zahlreichen Branchen. Mit unseren digital vernetzbaren Automationslösungen für effiziente Automationssysteme gehören wir zu den Wegbereitern von Industrie 4.0 und IIoT. Begleiten Sie uns auf diesen Weg die Industrie smarter, digitaler und nachhaltiger zu gestalten. Als Familienunternehmen, geprägt von starken Werten, setzen wir auf Vielfalt und Inklusion.... | | Anzeige ansehen | Ingenieure und technische Berufe |
|
F.S. Moderator
    
 Beiträge: 1896 Registriert: 23.04.2003 EPLAN Electric P8 2024 Prof.
|
erstellt am: 29. Mai. 2015 10:57 <-- editieren / zitieren --> Unities abgeben:          Nur für Sbg Markus
Hier: Code:
public class Script { [Start] public void AutoTreat() { Progress progress = new Progress("SimpleProgress"); progress.BeginPart(100, ""); progress.SetAllowCancel(true); if (!progress.Canceled()) { System.Diagnostics.Process.Start(@"g:\EPLAN\Zusatz_Programme\BAT_Dateien\AB-AV\Schilder BMK.bat"); progress.EndPart(); } progress.EndPart(true); //Aktuelles Projekt schließen ActionCallingContext ProjektContext = new ActionCallingContext(); CommandLineInterpreter CommandLineInterpreter = new CommandLineInterpreter(); ProjektContext.AddParameter("NOCLOSE", "0"); CommandLineInterpreter.Execute("XPrjActionProjectClose", ProjektContext); } }
------------------ grüße FrankS Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
| Anzeige.:
Anzeige: (Infos zum Werbeplatz >>)
 |