Mit diesem sehr praktischen Script, wird das Kontextmenü im grafischen Editor um den Punkt Seite drucken erweitert.

Vielen Dank an Krischan für die Umsetzung.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Seite drucken (46)

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
66
67
68
69
70
71
72
73
74
75
76
77
//
//  Dieses Skript fügt einen Menüpunkt "Seite drucken" im Kontextmenü des 
//  grafischen Editors hinzu. Die Seite wird über den vom Benutzer als
//  Standard definierten Drucker ausgegeben.
//
//  Christian Klasen  
//
using System.Windows.Forms;
using Eplan.EplApi.ApplicationFramework;
using Eplan.EplApi.Base;
using Eplan.EplApi.Scripting;
 
public class Class
{
    [DeclareRegister]
    public void Register()
    {
        MessageBox.Show("Script geladen.");
 
        return;
    }
 
    [DeclareUnregister]
    public void UnRegister()
    {
        MessageBox.Show("Script entladen.");
 
        return;
    }
 
 
    [DeclareAction("MenuAction")]
    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;
    }
 
    [DeclareMenu]
    public void MenuFunction()
    {
        Eplan.EplApi.Gui.ContextMenu oMenu =
            new Eplan.EplApi.Gui.ContextMenu();
 
        Eplan.EplApi.Gui.ContextMenuLocation oLocation =
            new Eplan.EplApi.Gui.ContextMenuLocation(
                "Editor",
                "Ged"
                );
 
        oMenu.AddMenuItem(
            oLocation,
            "Seite drucken",
            "MenuAction",
            true,
            false
            );
 
        return;
    }
 
}