Werden Makros in EPLAN über die Funktion “Makro aktualisieren” erneuert, wird leider der Wertesatz auf den Ursprungswert gesetzt.

Mit diesem Script wird der Wertesatz nicht verändert.

Die Action überschreibt die eigentlich EPLAN-Action. Da es hier zu einem Bufferoverflow kommen würde muss die eigentliche Action mit dem ActionCallingContext ausgestattet werden.

XGedUpdateMacroAction

 

XGedUpdateMacroAction (1361 Downloads )

 

using Eplan.EplApi.ApplicationFramework;
using Eplan.EplApi.Scripting;

namespace ibKastl.Scripts.Global
{
    class XGedUpdateMacroAction_Overload
    {
        [DeclareAction("XGedUpdateMacroAction", 50)] // Overwrite with ordinal
        public void Action()
        {
            ActionCallingContext actionCallingContext = new ActionCallingContext();
            actionCallingContext.AddParameter("AutoAssignLastUsedRecord", "1");
            Eplan.EplApi.ApplicationFramework.Action action = new ActionManager().FindBaseActionFromFunctionAction(false); // Full Namespace, couse of compiler warning in EPLAN
            action.Execute(actionCallingContext);
        }
    }
}