using System.Windows.Forms; using Eplan.EplApi.ApplicationFramework; using Eplan.EplApi.Base; using Eplan.EplApi.Scripting; public class pdfExport { [Start] [DeclareAction("pdfExport")] public void Function() { string strFullProjectname = PathMap.SubstitutePath("$(P)"); string strProjectpath = @"H:\keytech\"; //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; } }