Action überschreiben
Es ist im Scripting möglich Actions von EPLAN auch zu überschreiben. Das sollte aber mit großer Vorsicht geschehen.
Einen konkreten Anwendungsfall hab ich in einem fertigen Script schon mal hier implementiert.
SGB Markus aus dem CAD.de Forum, vielen Dank dafür, hat vom grandiosen API-Support auch eine Lösung bekommen um Parameter abzufragen. Dazu muss der Parametername bekannt sein. Diesen einfach als Parameter in die Methode und fertig :^)
using Eplan.EplApi.ApplicationFramework;
using Eplan.EplApi.Scripting;
class Program
{
[DeclareAction("GfDlgMgrActionIGfWind", 50)]
public void Action(string function)
{
// Do something before action is called
switch (function.ToLower())
{
case "copy":
// Do something at copy
break;
case "cut":
// Do something at cut
break;
case "paste":
// Do something at paste
break;
}
// Call the original action
ActionManager actionManager = new ActionManager();
Eplan.EplApi.ApplicationFramework.Action action = actionManager.FindBaseActionFromFunctionAction(true);
ActionCallingContext actionCallingContext = new ActionCallingContext();
actionCallingContext.AddParameter("function", function); // add parameter again
action.Execute(actionCallingContext);
}
}
