using System; using System.Diagnostics; using System.Threading; using System.Windows.Forms; using Eplan.EplApi.ApplicationFramework; using Eplan.EplApi.Base; using Eplan.EplApi.Scripting; class Program { [Start] public void Action() { // Get selected pages var pages = GetPages(); // Setup progressbar Progress progress = new Progress("EnhancedProgress"); progress.SetTitle("Do Something with pages"); progress.SetAllowCancel(true); progress.ShowImmediately(); progress.SetNeededSteps(pages.Length + 1); try { // Do something with pages foreach (var page in pages) { progress.SetActionText(page); progress.Step(1); SelectPage(page); MessageBox.Show(page, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); var Beschreibung = XEsGetPagePropertyAction /PropertyId:11011 /PropertyIndex:0 /PropertyValue; MessageBox.Show(Beschreibung, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception exception) { MessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { progress.EndPart(true); } } private static string[] GetPages() { ActionCallingContext actionCallingContext = new ActionCallingContext(); string pagesString = string.Empty; actionCallingContext.AddParameter("TYPE", "PAGES"); new CommandLineInterpreter().Execute("selectionset", actionCallingContext); actionCallingContext.GetParameter("PAGES", ref pagesString); string[] pages = pagesString.Split(';'); return pages; } private void SelectPage(string page) { ActionCallingContext actionCallingContext = new ActionCallingContext(); actionCallingContext.AddParameter("PAGENAME", page); new CommandLineInterpreter().Execute("edit", actionCallingContext); } }