PrintPages
Nachdem wir dank Krischan aus dem grafischen Editor Drucken können, wollte ich die Funktion auch im grafischen Editor haben.
Script laden und es erscheint ein neuer Menüpunkt im Seitennavigator:
PrintPages (68)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | using Eplan.EplApi.ApplicationFramework; using Eplan.EplApi.Base; using Eplan.EplApi.Scripting; public class PrintPages { [DeclareAction("PrintPages")] 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; } [DeclareMenu] public void MenuFunction() { Eplan.EplApi.Gui.ContextMenu oMenu = new Eplan.EplApi.Gui.ContextMenu(); Eplan.EplApi.Gui.ContextMenuLocation oLocation = new Eplan.EplApi.Gui.ContextMenuLocation( "PmPageObjectTreeDialog", "1007" ); oMenu.AddMenuItem( oLocation, "Seite(n) drucken", "PrintPages", true, false ); return; } } |



Anstatt
ruft den Druckdialog noch auf, zum Auswählen des Druckers.
Gruß
Andy