public class Script { [DeclareAction("DeleteSearch")] public void Bgischel () { string selectedProject = string.Empty; Eplan.EplApi.ApplicationFramework.ActionManager oMngr = new Eplan.EplApi.ApplicationFramework.ActionManager(); Eplan.EplApi.ApplicationFramework.Action oSelSetAction = oMngr.FindAction("selectionset"); if (oSelSetAction != null) { Eplan.EplApi.ApplicationFramework.ActionCallingContext ctx = new Eplan.EplApi.ApplicationFramework.ActionCallingContext(); ctx.AddParameter("TYPE", "PROJECT"); bool bRet = oSelSetAction.Execute(ctx); if (bRet) { ctx.GetParameter("PROJECT", ref selectedProject); } else { System.Windows.Forms.MessageBox.Show("Kein aktuelles Projekt gefunden."); } } else { System.Windows.Forms.MessageBox.Show("Aktion konnte nicht ausgeführt werden."); } Progress progress = new Progress("SimpleProgress"); progress.BeginPart(100,""); progress.SetAllowCancel(true); if(!progress.Canceled()) { progress.BeginPart(100,"ProjectClean"); ActionCallingContext projectCleanContext = new ActionCallingContext (); projectCleanContext.AddParameter("FILTERSCHEME","Fluid"); projectCleanContext.AddParameter("USEFILTER","0"); projectCleanContext.AddParameter("LogMsgActionDone","true"); projectCleanContext.AddParameter("PROJECTNAME", selectedProject); projectCleanContext.AddParameter("CONFIGSCHEME","Suchergebnislisten"); new CommandLineInterpreter().Execute("compress",projectCleanContext); progress.EndPart(); } progress.EndPart(true); } }