public void PrintPagesVoid() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); string strPages = string.Empty; acc.AddParameter("TYPE", "PAGES"); oCLI.Execute("selectionset", acc); acc.GetParameter("PAGES", ref strPages); Progress oProgress = new Progress("SimpleProgress"); oProgress.SetAllowCancel(true); oProgress.SetAskOnCancel(true); oProgress.SetNeededSteps(3); oProgress.SetTitle("Drucken"); oProgress.ShowImmediately(); foreach (string Page in strPages.Split(';')) { if (!oProgress.Canceled()) { acc.AddParameter("PAGENAME", Page); oCLI.Execute("print", acc); } else { break; } } oProgress.EndPart(true); return; }
public void MyEventHandlerFunction(IEventParameter iEventParameter) { try { EventParameterString oEventParameterString = new EventParameterString(iEventParameter); string sProjectname = oEventParameterString.String; //Projekt Ordner ermitteln var suffix = ".elk"; string sProjectFolder = sProjectname.Substring(0, sProjectname.Length - suffix.Length); sProjectFolder = sProjectFolder + ".edb"; //Wenn Makroprojekt, dann abbrechen string sProjectart = string.Empty; GetProjectProperty(sProjectFolder, 10902, "de_DE", out sProjectart); if (sProjectart == "2") { return; } //Einstellungen durchgehen Settings oSettings = new Settings(); for (int i = 1; i <= 5; i++) { if (i == 2) { continue; // Projektgruppe 2 auslassen, da diese für Makroprojekte vorgesehen ist } string sProjectgroup = oSettings.GetStringSetting(SettingsPath, i); if (sProjectgroup == "frei") { //Einstellung setzen oSettings.SetStringSetting(SettingsPath, sProjectname, i); //Projekteinstellung der Projektgruppe setzen ActionCallingContext acctranslate = new ActionCallingContext(); CommandLineInterpreter CLItranslate = new CommandLineInterpreter(); acctranslate.AddParameter("Project", sProjectname); acctranslate.AddParameter("set", "SettingsMasterDialog.ProjectGroup.ColorMode"); acctranslate.AddParameter("value", i.ToString()); acctranslate.AddParameter("index", "0"); CLItranslate.Execute("XAfActionSettingProject", acctranslate); //Schleife verlassen break; } } } catch (InvalidCastException exc) { new Decider().Decide(EnumDecisionType.eOkDecision, exc.Message, "OnPostOpenProject, Fehler", EnumDecisionReturn.eOK, EnumDecisionReturn.eOK, string.Empty, false, EnumDecisionIcon.eFATALERROR); } }
private void btnOk_Click(object sender, System.EventArgs e) { Cursor = Cursors.WaitCursor; CommandLineInterpreter oCLI = new CommandLineInterpreter(); pbr.PerformStep(); if (chkProjectcheck.Checked) { oCLI.Execute("AutomatedProjectCheck"); } pbr.PerformStep(); if (chkReport.Checked) { oCLI.Execute("reports"); } pbr.PerformStep(); pbr.Value = 0; Cursor = Cursors.Default; this.Close(); return; }
public void Function() { string projectsPath = PathMap.SubstitutePath("$(MD_PROJECTS)"); OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "ProjectInfo.xml|ProjectInfo.xml"; ofd.InitialDirectory = projectsPath; ofd.Title = "Projekteigenschaften auswählen:"; ofd.ValidateNames = false; if (ofd.ShowDialog() == DialogResult.OK) { Progress progress = new Progress("SimpleProgress"); progress.SetAllowCancel(false); progress.BeginPart(100, ""); progress.SetTitle("Projekteigenschaften importieren"); progress.ShowImmediately(); CommandLineInterpreter cli = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("TYPE", "READPROJECTINFO"); acc.AddParameter("FILENAME", ofd.FileName); cli.Execute("projectmanagement", acc); progress.EndPart(true); cli.Execute("XPrjActionPropertiesEdit"); } return; }
//Output entire project as a PDF public void PDFexport(string sZielDatei) { //Progressive on Eplan.EplApi.Base.Progress oProgress = new Eplan.EplApi.Base.Progress("SimpleProgress"); oProgress.ShowImmediately(); ActionCallingContext pdfContext = new ActionCallingContext(); pdfContext.AddParameter("type", "PDFPROJECTSCHEME"); //PDFPROJECTSCHEME = Export project in PDF format pdfContext.AddParameter("exportscheme", "NAME_SCHEMA"); //used scheme pdfContext.AddParameter("exportfile", sZielDatei); //Name export.Project, default value: Projectname pdfContext.AddParameter("exportmodel", "0"); //0 = do not spend any models pdfContext.AddParameter("blackwhite", "1"); //1 = PDF turns black and white pdfContext.AddParameter("useprintmargins", "1"); //1 = use printing margins pdfContext.AddParameter("readonlyexport", "2"); //1 = PDF becomes read - only pdfContext.AddParameter("usesimplelink", "1"); //1 = simple jump function pdfContext.AddParameter("usezoomlevel", "1"); //Jump in navigation pages pdfContext.AddParameter("fastwebview", "1"); //1 = fast web ad pdfContext.AddParameter("zoomlevel", "1"); //if USEZOOMLEVEL to 1 then here zoom level in mm CommandLineInterpreter cmdLineItp = new CommandLineInterpreter(); cmdLineItp.Execute("export", pdfContext); //Progressbar off oProgress.EndPart(true); return; }
/// <summary> /// Macrobox has to be selected in graphical editor /// </summary> private void UpdateMacro() { CommandLineInterpreter interpreter = new CommandLineInterpreter(); interpreter.Execute("XGedUpdateMacroAction"); interpreter.Execute("XMSelectObjectsInsideMacroBoxAction"); }
private void ExecutePDFExport(string projectFullPath) { EnumDecisionReturn result = MessageBoxShow(EnumDecisionType.eYesNoDecision, string.Format("Do you want to create PDF for {0}?", projectFullPath), "PDF-Export", EnumDecisionReturn.eYES, EnumDecisionIcon.eQUESTION); if (result == EnumDecisionReturn.eYES) { Progress oProgress = new Progress("SimpleProgress"); oProgress.SetAllowCancel(true); oProgress.SetAskOnCancel(true); oProgress.BeginPart(100, ""); oProgress.ShowImmediately(); CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("TYPE", "PDFPROJECTSCHEME"); acc.AddParameter("PROJECTNAME", projectFullPath); acc.AddParameter("EXPORTFILE", string.Format("{0}\\EPLANScript\\{1}_{2}.pdf", Environment.GetFolderPath(Environment.SpecialFolder.Desktop), PathMap.SubstitutePath("$(PROJECTNAME)"), DateTime.Now.ToString("yyMMdd.HHmmssfff"))); acc.AddParameter("EXPORTSCHEME", "EPLAN_default_value"); oCLI.Execute("export", acc); oProgress.EndPart(true); } return; }
public void SetSortCodeAction() { //Use a Command Line Interpreter to call the Action CommandLineInterpreter CLI = new CommandLineInterpreter(); Eplan.EplApi.Base.Settings set = new Eplan.EplApi.Base.Settings(); if(!set.ExistSetting("USER.SCRIPTS.SORTCODE")) { bool bOk = set.AddNumericSetting("USER.SCRIPTS.SORTCODE", new int[] { 0 }, new Range[] { new Range { FromValue = 0, ToValue = 32768}}, "Sort code setting", new int[] { 0 }, ISettings.CreationFlag.Insert); } int index = set.GetNumericSetting("USER.SCRIPTS.SORTCODE", 0); ActionCallingContext ctx1 = new ActionCallingContext(); ctx1.AddParameter("propertyID","20809"); //Sort code ctx1.AddParameter("propertyIndex","0"); ctx1.AddParameter("propertyValue", index.ToString()); CLI.Execute("XEsSetPropertyAction", ctx1); set.SetNumericSetting("USER.SCRIPTS.SORTCODE", ++index, 0); return; }
private void Awake() { m_commandDataBase = GetComponent <CommandDataBase>(); m_commandLineInterpreter = GetComponent <CommandLineInterpreter>(); m_parsedCommands = new ArrayList(MAX_COMMAND_MEMORY_BATCH_SIZE); }
//Gesamtes Project als PDF ausgeben public void PDFexport(string sZielDatei) { //Progressbar ein Eplan.EplApi.Base.Progress oProgress = new Eplan.EplApi.Base.Progress("SimpleProgress"); oProgress.ShowImmediately(); ActionCallingContext pdfContext = new ActionCallingContext(); pdfContext.AddParameter("type", "PDFPROJECTSCHEME"); //PDFPROJECTSCHEME = Project im PDF-Format exportieren //pdfContext.AddParameter("exportscheme", "NAME_SCHEMA"); //verwendetes Schema pdfContext.AddParameter("exportfile", sZielDatei); //Name export.Project, Vorgabewert: Projectname pdfContext.AddParameter("exportmodel", "0"); //0 = keine Modelle ausgeben pdfContext.AddParameter("blackwhite", "1"); //1 = PDF wird schwarz-weiss pdfContext.AddParameter("useprintmargins", "1"); //1 = Druckränder verwenden pdfContext.AddParameter("readonlyexport", "2"); //1 = PDF wird schreibgeschützt pdfContext.AddParameter("usesimplelink", "1"); //1 = einfache Sprungfunktion pdfContext.AddParameter("usezoomlevel", "1"); //Springen in Navigationsseiten pdfContext.AddParameter("fastwebview", "1"); //1 = schnelle Web-Anzeige pdfContext.AddParameter("zoomlevel", "1"); //wenn USEZOOMLEVEL auf 1 dann hier Zoomstufe in mm CommandLineInterpreter cmdLineItp = new CommandLineInterpreter(); cmdLineItp.Execute("export", pdfContext); //'Progressbar aus oProgress.EndPart(true); return; }
public void Function() { CommandLineInterpreter cli = new CommandLineInterpreter(); cli.Execute("reports"); return; }
public void Function() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); string strPages = string.Empty; acc.AddParameter("TYPE", "PAGES"); oCLI.Execute("selectionset", acc); acc.GetParameter("PAGES", ref strPages); string[] strPagesCount = strPages.Split(';'); int intPagesCount = strPagesCount.Length; string strProjectname = PathMap.SubstitutePath("$(PROJECTNAME)"); MessageBox.Show("Anzahl markierter Seiten:\n" + "►►► " + intPagesCount.ToString() + " ◄◄◄", "Markierte Seiten [" + strProjectname + "]", MessageBoxButtons.OK, MessageBoxIcon.Information); return; }
public PeerListService(IConfiguration configuration, ILoggable logger, IPeerList peers) { Configuration = configuration; Logger = logger; Peers = peers; if (MasterKey.Address != EndPoint.Address) { throw new ArgumentException("MasterKey enode mismatch"); } // TCP server start Server = new TcpServer() { OnStart = OnTcpStart, OnStop = OnTcpStop, OnAccept = OnTcpAccept, OnClose = OnTcpClose, OnMessage = OnTcpMessage }; commandLineInterpreter = new CommandLineInterpreter() { OnCommand = OnConsoleCommand }; }
public void ClearSearch() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); oCLI.Execute("XSeShowSearchResultsAction"); oCLI.Execute("GfDlgMgrActionIGfWind /function:DeleteAll"); }
//Gesamtes Projekt als PXF ausgeben public void PXFexport(string sFilename) { //Progressbar ein Progress oProgress = new Progress("SimpleProgress"); oProgress.SetTitle("Documentation-Tool"); oProgress.SetActionText("Projektdaten exportieren"); oProgress.ShowImmediately(); Application.DoEvents(); // Screen aktualisieren ActionCallingContext pxfContext = new ActionCallingContext(); pxfContext.AddParameter("TYPE", "PXFPROJECT"); pxfContext.AddParameter("EXPORTFILE", sFilename); pxfContext.AddParameter("EXPORTMASTERDATA", "0"); //Stammdaten mit exportieren (Standard = 1(Ja) pxfContext.AddParameter("EXPORTCONNECTIONS", "0"); //Verbindungen mit exportieren (Standard = 0(Nein) CommandLineInterpreter cmdLineItp = new CommandLineInterpreter(); cmdLineItp.Execute("export", pxfContext); //Progressbar aus oProgress.EndPart(true); return; }
public void Function() { Eplan.EplApi.Base.BaseException bexAssert = new BaseException("Assert", MessageLevel.Assert); bexAssert.FixMessage(); Eplan.EplApi.Base.BaseException bexError = new BaseException("Error", MessageLevel.Error); bexError.FixMessage(); Eplan.EplApi.Base.BaseException bexFatalError = new BaseException("FatalError", MessageLevel.FatalError); bexFatalError.FixMessage(); Eplan.EplApi.Base.BaseException bexMessage = new BaseException("Message", MessageLevel.Message); bexMessage.FixMessage(); Eplan.EplApi.Base.BaseException bexTrace = new BaseException("Trace", MessageLevel.Trace); bexTrace.FixMessage(); Eplan.EplApi.Base.BaseException bexWarning = new BaseException("Warning", MessageLevel.Warning); bexWarning.FixMessage(); CommandLineInterpreter oCLI = new CommandLineInterpreter(); oCLI.Execute("SystemErrDialog"); return; }
public void Function() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); Progress oProgress = new Progress("EnhancedProgress"); oProgress.SetAllowCancel(false); oProgress.ShowImmediately(); oProgress.BeginPart(33, "Part 1"); oCLI.Execute("generate /TYPE:CONNECTIONS"); oProgress.EndPart(); oProgress.BeginPart(33, "Part 2"); oCLI.Execute("reports"); oProgress.EndPart(); oProgress.BeginPart(33, "Part 3"); oCLI.Execute("compress /FILTERSCHEME:Standard"); oProgress.EndPart(); oProgress.EndPart(true); return; }
public void Function() { BaseException bexAssert = new BaseException("Assert", MessageLevel.Assert); bexAssert.FixMessage(); BaseException bexError = new BaseException("Error", MessageLevel.Error); bexError.FixMessage(); BaseException bexFatalError = new BaseException("FatalError", MessageLevel.FatalError); bexFatalError.FixMessage(); BaseException bexMessage = new BaseException("Message", MessageLevel.Message); bexMessage.FixMessage(); BaseException bexTrace = new BaseException("Trace", MessageLevel.Trace); bexTrace.FixMessage(); BaseException bexWarning = new BaseException("Warning", MessageLevel.Warning); bexWarning.FixMessage(); CommandLineInterpreter oCLI = new CommandLineInterpreter(); oCLI.Execute("SystemErrDialog"); return; }
public void Function() { string strFullProjectname = PathMap.SubstitutePath("$(P)"); string projectsPath = PathMap.SubstitutePath("$(MD_PROJECTS)"); string projectName = PathMap.SubstitutePath("$(PROJECTNAME)"); string date = DateTime.Now.ToString("yyyy-MM-dd"); string time = DateTime.Now.ToString("HH-mm-ss"); string backupDirectory = Path.Combine(projectsPath, "Backup"); string backupFileName = projectName + "_" + date + "_" + time + ".zw1"; string backupFullFileName = Path.Combine(backupDirectory, backupFileName); if (!Directory.Exists(backupDirectory)) { Directory.CreateDirectory(backupDirectory); } Progress progress = new Progress("SimpleProgress"); progress.SetAllowCancel(true); progress.SetAskOnCancel(true); progress.BeginPart(100, ""); progress.SetTitle("Backup"); progress.ShowImmediately(); if (!progress.Canceled()) { CommandLineInterpreter cli = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("BACKUPAMOUNT", "BACKUPAMOUNT_ALL"); acc.AddParameter("BACKUPMEDIA", "DISK"); acc.AddParameter("BACKUPMETHOD", "BACKUP"); acc.AddParameter("COMPRESSPRJ", "1"); acc.AddParameter("INCLEXTDOCS", "1"); acc.AddParameter("INCLIMAGES", "1"); acc.AddParameter("ARCHIVENAME", backupFileName); acc.AddParameter("DESTINATIONPATH", backupDirectory); acc.AddParameter("TYPE", "PROJECT"); cli.Execute("backup", acc); } progress.EndPart(true); MessageBox.Show( "Backup wurde erfolgreich erstellt:" + Environment.NewLine + backupFullFileName, "Hinweis", MessageBoxButtons.OK, MessageBoxIcon.Information ); return; }
public static void OpenProject(string projectname) { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("PROJECTNAME", projectname); oCLI.Execute("EDIT", acc); }
public void XPamTranslateDatabaseActionFunction() { CommandLineInterpreter oCli = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("_cmdline", "XPamTranslateDatabaseAction"); oCli.Execute("XPamTranslateDatabaseAction", acc); }
public void Function() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); oCLI.Execute("XGedUpdateMacroAction"); return; }
public void Function() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); oCLI.Execute("reports"); return; }
public void ChangePLCMnemonik(string DestMnemonik) { // Check target mnemonic if (DestMnemonik == string.Empty) { // No target mnemonic defined return; } // Empty clipboard System.Windows.Forms.Clipboard.Clear(); // Fill clipboard CommandLineInterpreter oCLI = new CommandLineInterpreter(); oCLI.Execute("GfDlgMgrActionIGfWind /function:Copy"); MessageBox.Show("Test 1 completed!"); // This can be used for testing to monitor that the private sub ran correctly. // Try mnemonic exchange #region change mnemonik if (System.Windows.Forms.Clipboard.ContainsText()) { sSourceText = System.Windows.Forms.Clipboard.GetText(); if (sSourceText != string.Empty) { switch (DestMnemonik) { case "IQ": //sSourceText = sSourceText.Replace("PED", "PID").Replace("PAD", "PQD").Replace("PEW", "PIW").Replace("PAW", "PQW").Replace("ED", "ID").Replace("AD", "QD").Replace("EW", "IW").Replace("AW", "QW").Replace("EB", "IB").Replace("AB", "QB").Replace("E", "I").Replace("A", "Q"); sSourceText = sSourceText.Replace("E", "I").Replace("A", "Q"); break; case "EA": //sSourceText = sSourceText.Replace("PID", "PED").Replace("PQD", "PAD").Replace("PIW", "PEW").Replace("PQW", "PAW").Replace("ID", "ED").Replace("QD", "AD").Replace("IW", "EW").Replace("QW", "AW").Replace("IB", "EB").Replace("QB", "AB").Replace("I", "E").Replace("Q", "A"); sSourceText = sSourceText.Replace("I", "E").Replace("Q", "A"); break; default: return; } try { System.Windows.Forms.Clipboard.SetText(sSourceText); oCLI.Execute("GfDlgMgrActionIGfWind /function:Paste"); } catch (System.Exception ex) { MessageBox.Show(ex.Message, "Error...", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } #endregion }
public void Function() { string strProjectpath = PathMap.SubstitutePath("$(PROJECTPATH)"); string strProjectname = PathMap.SubstitutePath("$(PROJECTNAME)"); string strFullProjectname = PathMap.SubstitutePath("$(P)"); string strDate = DateTime.Now.ToString("yyyy-MM-dd"); string strTime = DateTime.Now.ToString("hh-mm-ss"); string strBackupDirectory = strProjectpath + @"\Backup\"; string strBackupFilename = strProjectname + "_Backup_" + strDate + "_" + strTime; if (!System.IO.Directory.Exists(strBackupDirectory)) { System.IO.Directory.CreateDirectory(strBackupDirectory); } Progress oProgress = new Progress("SimpleProgress"); oProgress.SetAllowCancel(true); oProgress.SetAskOnCancel(true); oProgress.BeginPart(100, ""); oProgress.SetTitle("Backup"); oProgress.ShowImmediately(); if (!oProgress.Canceled()) { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("BACKUPMEDIA", "DISK"); acc.AddParameter("ARCHIVENAME", strBackupFilename); acc.AddParameter("BACKUPMETHOD", "BACKUP"); acc.AddParameter("COMPRESSPRJ", "1"); acc.AddParameter("INCLEXTDOCS", "1"); acc.AddParameter("BACKUPAMOUNT", "BACKUPAMOUNT_ALL"); acc.AddParameter("INCLIMAGES", "1"); acc.AddParameter("LogMsgActionDone", "true"); acc.AddParameter("DESTINATIONPATH", strBackupDirectory); acc.AddParameter("PROJECTNAME", strFullProjectname); acc.AddParameter("TYPE", "PROJECT"); oCLI.Execute("backup", acc); } oProgress.EndPart(true); MessageBox.Show( "Backup was created successfully:\n" + strBackupFilename, "Note", MessageBoxButtons.OK, MessageBoxIcon.Information ); return; }
/// <summary> /// The action XAfActionSettingProject is only available in version 2.3 and higher /// </summary> /// <param name="setting"></param> /// <param name="value"></param> private void SetProjectSetting(string setting, string value) { CommandLineInterpreter interpreter = new CommandLineInterpreter(); ActionCallingContext XAfActionSettingProjectContext = new ActionCallingContext(); XAfActionSettingProjectContext.AddParameter("set", setting); XAfActionSettingProjectContext.AddParameter("value", value); interpreter.Execute("XAfActionSettingProject", XAfActionSettingProjectContext); }
public static void ImportPrjSettings(string projectname, string settingsFile) { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("XMLFile", settingsFile); acc.AddParameter("Project", projectname); oCLI.Execute("XSettingsImport", acc); }
public void Function() { string strProjectpath = PathMap.SubstitutePath("$(PROJECTPATH)"); string strProjectname = PathMap.SubstitutePath("$(PROJECTNAME)"); string strFullProjectname = PathMap.SubstitutePath("$(P)"); string strDate = DateTime.Now.ToString("yyyy-MM-dd"); string strTime = DateTime.Now.ToString("hh-mm-ss"); string strBackupDirectory = strProjectpath + @"\Backup\"; string strBackupFilename = strProjectname + "_Backup_" + strDate + "_" + strTime; if (!System.IO.Directory.Exists(strBackupDirectory)) { System.IO.Directory.CreateDirectory(strBackupDirectory); } Progress oProgress = new Progress("SimpleProgress"); oProgress.SetAllowCancel(true); oProgress.SetAskOnCancel(true); oProgress.BeginPart(100, ""); oProgress.SetTitle("Backup"); oProgress.ShowImmediately(); if (!oProgress.Canceled()) { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("BACKUPMEDIA", "DISK"); acc.AddParameter("ARCHIVENAME", strBackupFilename); acc.AddParameter("BACKUPMETHOD", "BACKUP"); acc.AddParameter("COMPRESSPRJ", "1"); acc.AddParameter("INCLEXTDOCS", "1"); acc.AddParameter("BACKUPAMOUNT", "BACKUPAMOUNT_ALL"); acc.AddParameter("INCLIMAGES", "1"); acc.AddParameter("LogMsgActionDone", "true"); acc.AddParameter("DESTINATIONPATH", strBackupDirectory); acc.AddParameter("PROJECTNAME", strFullProjectname); acc.AddParameter("TYPE", "PROJECT"); oCLI.Execute("backup", acc); } oProgress.EndPart(true); MessageBox.Show( "Backup wurde erfolgreich erstellt:\n" + strBackupFilename, "Hinweis", MessageBoxButtons.OK, MessageBoxIcon.Information ); return; }
public void MultilanguageToolExamples_Settings_Void() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); oCLI.Execute("XTrSettingsDlgAction"); // Settings DEFAULT // Translate on input #region SetTranslationOnInput acc.AddParameter("ACTIVE", "YES"); // parameters: YES, NO oCLI.Execute("SetTranslationOnInput", acc); oCLI.Execute("XTrSettingsDlgAction"); #endregion // Case sensitive #region SetMatchCase acc.AddParameter("ACTIVE", "YES"); // parameters: YES, NO oCLI.Execute("SetMatchCase", acc); oCLI.Execute("XTrSettingsDlgAction"); #endregion // Already translated texts change #region SetChangeTranslatedText acc.AddParameter("ACTIVE", "YES"); // parameters: YES, NO oCLI.Execute("SetChangeTranslatedText", acc); oCLI.Execute("XTrSettingsDlgAction"); #endregion // Manual selection for multiple meanings #region SetManualSelectionForMultipleMeanings acc.AddParameter("ACTIVE", "YES"); // parameters: YES, NO oCLI.Execute("SetManualSelectionForMultipleMeanings", acc); oCLI.Execute("XTrSettingsDlgAction"); #endregion // Segment #region SetTranslationSegment acc.AddParameter("SEGMENT", "ENTIRE ENTRY"); // parameters: WORD, SENTENCE, ENTIRE ENTRY oCLI.Execute("SetTranslationSegment", acc); oCLI.Execute("XTrSettingsDlgAction"); #endregion // Case sensitive #region SetUpperLowerCase acc.AddParameter("TYPE", "ALLUPPERCASE"); // parameters: ACCORDINGTODICTIONARY, ALLUPPERCASE, ALLLOWERCASE, CAPITALIZEFIRSTLETTER oCLI.Execute("SetUpperLowerCase", acc); oCLI.Execute("XTrSettingsDlgAction"); #endregion // Missing translation: Ads #region SetShowMissingTranslation acc.AddParameter("ACTIVE", "YES"); // parameters: YES, NO oCLI.Execute("SetShowMissingTranslation", acc); oCLI.Execute("XTrSettingsDlgAction"); #endregion }
public void MultilanguageToolExamples_Settings_Void() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); oCLI.Execute("XTrSettingsDlgAction"); // Settings DEFAULT // Bei Eingabe übersetzen #region SetTranslationOnInput acc.AddParameter("ACTIVE", "YES"); // parameters: YES, NO oCLI.Execute("SetTranslationOnInput", acc); oCLI.Execute("XTrSettingsDlgAction"); #endregion // Groß- / Kleinschreibung beachten #region SetMatchCase acc.AddParameter("ACTIVE", "YES"); // parameters: YES, NO oCLI.Execute("SetMatchCase", acc); oCLI.Execute("XTrSettingsDlgAction"); #endregion // Bereits übersetzte Texte verändern #region SetChangeTranslatedText acc.AddParameter("ACTIVE", "YES"); // parameters: YES, NO oCLI.Execute("SetChangeTranslatedText", acc); oCLI.Execute("XTrSettingsDlgAction"); #endregion // Manuelle Auswahl bei Mehrfachbedeutungen #region SetManualSelectionForMultipleMeanings acc.AddParameter("ACTIVE", "YES"); // parameters: YES, NO oCLI.Execute("SetManualSelectionForMultipleMeanings", acc); oCLI.Execute("XTrSettingsDlgAction"); #endregion // Segment #region SetTranslationSegment acc.AddParameter("SEGMENT", "ENTIRE ENTRY"); // parameters: WORD, SENTENCE, ENTIRE ENTRY oCLI.Execute("SetTranslationSegment", acc); oCLI.Execute("XTrSettingsDlgAction"); #endregion // Groß- / Kleinschreibung #region SetUpperLowerCase acc.AddParameter("TYPE", "ALLUPPERCASE"); // parameters: ACCORDINGTODICTIONARY, ALLUPPERCASE, ALLLOWERCASE, CAPITALIZEFIRSTLETTER oCLI.Execute("SetUpperLowerCase", acc); oCLI.Execute("XTrSettingsDlgAction"); #endregion // Fehlende Übersetzung: Anzeigen #region SetShowMissingTranslation acc.AddParameter("ACTIVE", "YES"); // parameters: YES, NO oCLI.Execute("SetShowMissingTranslation", acc); oCLI.Execute("XTrSettingsDlgAction"); #endregion }
public void ChangePLCMnemonik(string DestMnemonik) { //Prüfe Zielmnemonik if (DestMnemonik == string.Empty) { //keine Zielmnemonik definiert return; } //Zwischenablage leeren System.Windows.Forms.Clipboard.Clear(); //Zwischenablage füllen CommandLineInterpreter oCLI = new CommandLineInterpreter(); oCLI.Execute("GfDlgMgrActionIGfWind /function:Copy"); //Mnemonik-Tausch versuchen #region change mnemonik if (System.Windows.Forms.Clipboard.ContainsText()) { sSourceText = System.Windows.Forms.Clipboard.GetText(); if (sSourceText != string.Empty) { switch (DestMnemonik) { case "IQ": //sSourceText = sSourceText.Replace("PED", "PID").Replace("PAD", "PQD").Replace("PEW", "PIW").Replace("PAW", "PQW").Replace("ED", "ID").Replace("AD", "QD").Replace("EW", "IW").Replace("AW", "QW").Replace("EB", "IB").Replace("AB", "QB").Replace("E", "I").Replace("A", "Q"); sSourceText = sSourceText.Replace("E", "I").Replace("A", "Q"); break; case "EA": //sSourceText = sSourceText.Replace("PID", "PED").Replace("PQD", "PAD").Replace("PIW", "PEW").Replace("PQW", "PAW").Replace("ID", "ED").Replace("QD", "AD").Replace("IW", "EW").Replace("QW", "AW").Replace("IB", "EB").Replace("QB", "AB").Replace("I", "E").Replace("Q", "A"); sSourceText = sSourceText.Replace("I", "E").Replace("Q", "A"); break; default: return; break; } try { System.Windows.Forms.Clipboard.SetText(sSourceText); oCLI.Execute("GfDlgMgrActionIGfWind /function:Paste"); } catch (System.Exception ex) { MessageBox.Show(ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } #endregion }
public void InsertPageMacroVoid() { string strFilename = @"C:\test.emp"; ActionCallingContext oAcc = new ActionCallingContext(); CommandLineInterpreter oCLI = new CommandLineInterpreter(); oAcc.AddParameter("filename", strFilename); oCLI.Execute("XMInsertPageMacro", oAcc); }
public void Function() { CommandLineInterpreter cli = new CommandLineInterpreter(); cli.Execute("XMsgActionStartVerification"); cli.Execute("reports"); cli.Execute("Actionname"); return; }
/// <summary> /// Erstellt ein neues Projekt anhand einer Projekt-Exportdatei /// </summary> /// <param name="epjFilePath">Absoluter Dateipfad zur Exportdateil "C:\..\*.epj"</param> /// <param name="targetProject">Absoluter Dateipfad zum Zielprojekt "C:\..\*.elk"</param> public static void ImportProjectEPJ(string epjFilePath, string targetProject) { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("TYPE", "PXFPROJECT"); acc.AddParameter("IMPORTFILE", epjFilePath); acc.AddParameter("PROJECTNAME", targetProject); oCLI.Execute("IMPORT", acc); }
public void Function() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); oCLI.Execute("XMsgActionStartVerification"); oCLI.Execute("reports"); oCLI.Execute("Actionname"); return; }
public void Function(int SET) { try { string strScripts = PathMap.SubstitutePath("$(MD_SCRIPTS)" + @"\"); string strProject = PathMap.SubstitutePath("$(P)"); string strMessage = string.Empty; CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("Project", strProject); switch (SET) { case 1: strMessage = "[Wie gezeichnet]"; acc.AddParameter("XMLFile", strScripts + @"1.xml"); break; case 2: strMessage = "[Als Punkt]"; acc.AddParameter("XMLFile", strScripts + @"2.xml"); break; case 3: strMessage = "[Mit Zielfestlegung]"; acc.AddParameter("XMLFile", strScripts + @"3.xml"); break; default: MessageBox.Show("Parameter nicht bekannt", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } oCLI.Execute("XSettingsImport", acc); MessageBox.Show("Einstellungen wurden importiert.\n" + strMessage, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show(ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error); } return; }
public void Function() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("ScriptFile", @"C:\EPLAN Scripting Project\01_Erste_Schritte\01_Start.cs"); oCLI.Execute("ExecuteScript", acc); return; }
public void Function() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("Name", "XGedIaFormatText"); acc.AddParameter("height", "20"); oCLI.Execute("XGedStartInteractionAction", acc); return; }
public void Function() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("TYPE", "DXFPAGE"); acc.AddParameter("IMPORTFILE", @"C:\DXF\Smile.dxf"); oCLI.Execute("import", acc); return; }
public void Function() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("TYPE", "PROJECT"); oCLI.Execute("print", acc); MessageBox.Show("Action ausgeführt."); return; }
public void Function() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("PAGENAME", "=+/1"); acc.AddParameter("DEVICENAME", "=+-1K1"); acc.AddParameter("FORMAT", "XDLTxtImporterExporter"); oCLI.Execute("edit", acc); return; }
public void Execute() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); string ActionReturnParameterValue = string.Empty; acc.AddParameter("Language", "Project"); // parameters: "Project" or "Display" acc.AddParameter("DialogName", "MyDialogName"); oCLI.Execute("SelectLanguage", acc); acc.GetParameter("Language", ref ActionReturnParameterValue); MessageBox.Show("Language from SelectLanguage:\n\n---> " + ActionReturnParameterValue); }
public void Function() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("CONFIGSCHEME", "Standard"); acc.AddParameter("FILTERSCHEME", "Allpolig"); oCLI.Execute("compress", acc); MessageBox.Show("Action ausgeführt."); return; }
public void PagePdfVoid() { FolderBrowserDialog fbd = new FolderBrowserDialog(); CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); if (fbd.ShowDialog() != DialogResult.OK) { return; } Progress oProgress = new Progress("SimpleProgress"); oProgress.SetAllowCancel(true); oProgress.SetAskOnCancel(true); oProgress.BeginPart(100, ""); oProgress.ShowImmediately(); try { string strPages = string.Empty; acc.AddParameter("TYPE", "PAGES"); oCLI.Execute("selectionset", acc); acc.GetParameter("PAGES", ref strPages); foreach (string CurrentPage in strPages.Split(';')) { if (!oProgress.Canceled()) { acc.AddParameter("TYPE", "PDFPAGESSCHEME"); acc.AddParameter("PAGENAME", CurrentPage); acc.AddParameter("EXPORTFILE", fbd.SelectedPath + @"\" + CurrentPage); acc.AddParameter("EXPORTSCHEME", "EPLAN_default_value"); oCLI.Execute("export", acc); } else { oProgress.EndPart(true); return; } } Process.Start(fbd.SelectedPath); oProgress.EndPart(true); } catch (System.Exception ex) { oProgress.EndPart(true); MessageBox.Show("Error", ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void Function() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("Project", @"C:\Projekte\Beispielprojekt.elk"); acc.AddParameter("Action", "reports"); acc.AddParameter("NOCLOSE", "1"); oCLI.Execute("ProjectAction", acc); MessageBox.Show("Action ausgeführt."); return; }
public void Function() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("PropertyId", "10013"); acc.AddParameter("PropertyIndex", "0"); acc.AddParameter("PropertyValue", "23542"); oCLI.Execute("XEsSetProjectPropertyAction", acc); MessageBox.Show("Action ausgeführt."); return; }
public void ResetSortCodeAction() { //Use a Command Line Interpreter to call the Action CommandLineInterpreter CLI = new CommandLineInterpreter(); Eplan.EplApi.Base.Settings set = new Eplan.EplApi.Base.Settings(); if(!set.ExistSetting("USER.SCRIPTS.SORTCODE")) { bool bOk = set.AddNumericSetting("USER.SCRIPTS.SORTCODE", new int[] { 0 }, new Range[] { new Range { FromValue = 0, ToValue = 32768}}, "Sort code setting", new int[] { 0 }, ISettings.CreationFlag.Insert); } set.SetNumericSetting("USER.SCRIPTS.SORTCODE", 0, 0); return; }
public void Function() { string strProjectpath = PathMap.SubstitutePath("$(PROJECTPATH)") + @"\"; CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("TYPE", "EXPORT"); acc.AddParameter("EXPORTFILE", strProjectpath + "Partlist.txt"); acc.AddParameter("FORMAT", "XPalCSVConverter"); oCLI.Execute("partslist", acc); MessageBox.Show("Action ausgeführt."); return; }
public void Function() { string strFullProjectname = PathMap.SubstitutePath("$(P)"); string strProjectpath = PathMap.SubstitutePath("$(PROJECTPATH)" + @"\"); string strProjectname = PathMap.SubstitutePath("$(PROJECTNAME)"); DialogResult Result = MessageBox.Show( "Soll ein PDF für das Projekt\n'" + strProjectname + "'\nerzeugt werden?", "PDF-Export", MessageBoxButtons.YesNo, MessageBoxIcon.Question ); if (Result == DialogResult.Yes) { Progress oProgress = new Progress("SimpleProgress"); oProgress.SetAllowCancel(true); oProgress.SetAskOnCancel(true); oProgress.BeginPart(100, ""); oProgress.ShowImmediately(); CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("TYPE", "PDFPROJECTSCHEME"); acc.AddParameter("PROJECTNAME", strFullProjectname); acc.AddParameter("EXPORTFILE", strProjectpath + strProjectname); acc.AddParameter("EXPORTSCHEME", "EPLAN_default_value"); oCLI.Execute("export", acc); oProgress.EndPart(true); } return; }
public void MultilanguageToolExamples_Get_Void() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); string ActionReturnParameterValue = string.Empty; string strMessage = string.Empty; #region GetProjectLanguages oCLI.Execute("GetProjectLanguages", acc); acc.GetParameter("LANGUAGELIST", ref ActionReturnParameterValue); string[] ProjectLanguages = ActionReturnParameterValue.Split(';'); foreach (string s in ProjectLanguages) { strMessage = strMessage + s + "\n"; } MessageBox.Show(strMessage, "GetProjectLanguages"); strMessage = string.Empty; #endregion #region GetDisplayLanguages oCLI.Execute("GetDisplayLanguages", acc); acc.GetParameter("LANGUAGELIST", ref ActionReturnParameterValue); string[] DisplayLanguages = ActionReturnParameterValue.Split(';'); foreach(string s in DisplayLanguages) { strMessage = strMessage + s + "\n"; } MessageBox.Show(strMessage, "GetDisplayLanguages"); strMessage = string.Empty; #endregion #region GetVariableLanguage oCLI.Execute("GetVariableLanguage", acc); acc.GetParameter("LANGUAGELIST", ref ActionReturnParameterValue); string VariableLanguage = ActionReturnParameterValue; strMessage = strMessage + VariableLanguage + "\n"; MessageBox.Show(strMessage, "GetVariableLanguage"); strMessage = string.Empty; #endregion }
public void Function() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("TYPE", "PROJECT"); acc.AddParameter("ARCHIVENAME", @"C:\Projekte\Beispielprojekt.zw1"); acc.AddParameter("PROJECTNAME", @"C:\Projekte\Beispielprojekt.elk"); acc.AddParameter("UNPACKPROJECT", "0"); acc.AddParameter("MODE", "1"); acc.AddParameter("NOCLOSE", "1"); oCLI.Execute("restore", acc); MessageBox.Show("Action ausgeführt."); return; }
public void ActionFunction() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); string strPages = string.Empty; acc.AddParameter("TYPE", "PAGES"); oCLI.Execute("selectionset", acc); acc.GetParameter("PAGES", ref strPages); acc.AddParameter("PAGENAME", strPages); oCLI.Execute("print", acc); //MessageBox.Show("Seite gedruckt"); return; }
public void MultilanguageToolExamples_Set_Void() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); oCLI.Execute("XTrSettingsDlgAction"); // Settings DEFAULT #region SetProjectLanguages acc.AddParameter("LANGUAGELIST", "de_DE;en_EN;zh_CN;"); oCLI.Execute("SetProjectLanguages", acc); oCLI.Execute("XTrSettingsDlgAction"); #endregion #region ChangeLanguage acc.AddParameter("varLANGUAGE","en_EN"); acc.AddParameter("dispLANGUAGE", "en_EN;zh_CN;"); oCLI.Execute("ChangeLanguage", acc); oCLI.Execute("XTrSettingsDlgAction"); #endregion }
public void Function() { CommandLineInterpreter oCLI = new CommandLineInterpreter(); ActionCallingContext acc = new ActionCallingContext(); acc.AddParameter("TYPE", "CABLES"); acc.AddParameter("CREATIONSCHEME", "Standard"); acc.AddParameter("NUMBERINGSCHEME", "Standard"); acc.AddParameter("AUTOSELECTSCHEME", "Standard"); acc.AddParameter("REGENERATECONNS", "1"); acc.AddParameter("KEEPOLDNAMES", "1"); acc.AddParameter("STARTVALUE", "1"); acc.AddParameter("STEPVALUE", "1"); acc.AddParameter("ONLYAUTOCABLES", "1"); acc.AddParameter("REBUILDALLCONNECTIONS", "1"); oCLI.Execute("generate", acc); MessageBox.Show("Action ausgeführt."); return; }