public class CSharpAction: Eplan.EplApi.ApplicationFramework.IEplAction
{
///<summary>
///This function is called when executing the action.
///</summary>
///<returns>true, if the action performed successfully</returns>
public bool Execute(Eplan.EplApi.ApplicationFramework.ActionCallingContext ctx )
{
new Decider().Decide(EnumDecisionType.eOkDecision, "CSharpAction was called!", "Eplan.EplAddIn.Demo1", EnumDecisionReturn.eOK, EnumDecisionReturn.eOK);
// TODO: Add your Code here
return true;
}
///<summary>
///This function is called by the application framework, when registering the add-in.
///</summary>
///<param name="Name">The action is registered in EPLAN under this name</param>
///<param name="Ordinal">The action is registered with this overload priority</param>
///<returns>true, if OnRegister succeeds</returns>
public bool OnRegister(ref string Name, ref int Ordinal)
{
Name = "CSharpAction";
Ordinal = 20;
return true;
}
///<summary>
/// Documentation function for the action, which is called by EPLAN on demand
/// returns the descriptive text for the action itself and if the action takes string parameters
/// (command line), it also provides the name and description of each parameter
///</summary>
///<param name="actionProperties"> This object needs to be filled with information about the action
///</param>
public void GetActionProperties(ref Eplan.EplApi.ApplicationFramework.ActionProperties actionProperties)
{
actionProperties.Description= "Action test with parameters.";
// description of first parameter
Eplan.EplApi.ApplicationFramework.ActionParameterProperties firstParam= new ActionParameterProperties();
firstParam.Set("Param1", "first test parameter");
actionProperties.AddParameter(firstParam);
// description of second parameter
// Eplan.EplApi.ApplicationFramework.ActionParameterProperties secondParam= new ActionParameterProperties();
// secondParam.Set("Param2", "Second parameter for test");
// actionProperties.AddParameter(secondParam);
}
}
Public Class VBAction
Implements Eplan.EplApi.ApplicationFramework.IEplAction
'''<summary>
'''This function is called when executing the action.
'''</summary>
'''<returns>true, if the action performed successfully</returns>
Public Function Execute(ctx As Eplan.EplApi.ApplicationFramework.ActionCallingContext) As Boolean _
Implements Eplan.EplApi.ApplicationFramework.IEplAction.Execute
Dim message as Decider = New Decider
message.Decide(EnumDecisionType.eOkDecision, "VBAction was called!", "Eplan.EplAddIn.VBDemo1", EnumDecisionReturn.eOK, EnumDecisionReturn.eOK)
' TODO: Add your Code here
Return True
End Function 'Execute
'''<summary>
'''This function is called by the application framework, when registering the add-in.
'''</summary>
'''<param name="Name">The action is registered in EPLAN under this name</param>
'''<param name="Ordinal">The action is registered with this overload priority</param>
'''<returns>true, if OnRegister succeeds</returns>
Public Function OnRegister(ByRef Name As String, ByRef Ordinal As Integer) As Boolean _
Implements Eplan.EplApi.ApplicationFramework.IEplAction.OnRegister
Name = "CSharpAction"
Ordinal = 20
Return True
End Function 'OnRegister
'''<summary>
''' Documentation function for the action, which is called by EPLAN on demand
''' returns the descriptive text for the action itself and if the action takes string parameters
''' (command line), it also provides the name and description of each parameter
'''</summary>
'''<param name="actionProperties"> This object needs to be filled with information about the action
'''</param>
Public Sub GetActionProperties(ByRef actionProperties As Eplan.EplApi.ApplicationFramework.ActionProperties) _
Implements Eplan.EplApi.ApplicationFramework.IEplAction.GetActionProperties
actionProperties.Description = "Action test with parameters."
' description of first parameter
Dim firstParam As New Eplan.EplApi.ApplicationFramework.ActionParameterProperties()
firstParam.Set("Param1", "first test parameter")
actionProperties.AddParameter(firstParam)
End Sub 'getActionProperties
End Class 'VBAction ' description of second parameter