02 Actions ausführen


01 Einzelne Action
using Eplan.EplApi.ApplicationFramework;
using Eplan.EplApi.Scripting;

public class _02_Actions_ausfuehren_01_Einzelne_Action
{
  [Start]
  public void Function()
  {
    CommandLineInterpreter cli = new CommandLineInterpreter();
    cli.Execute("reports");
    return;
  }
}


02 Mehrere Actions
using Eplan.EplApi.ApplicationFramework;
using Eplan.EplApi.Scripting;

public class _02_Actions_ausfuehren_02_Mehrere_Actions
{
  [Start]
  public void Function()
  {
    CommandLineInterpreter cli = new CommandLineInterpreter();

    cli.Execute("XMsgActionStartVerification");
    cli.Execute("reports");
    cli.Execute("Actionname");

    return;
  }
}


03 Action mit Parameter
using Eplan.EplApi.ApplicationFramework;
using Eplan.EplApi.Scripting;

public class _02_Actions_ausfuehren_03_Action_mit_Parameter
{
  [Start]
  public void Function()
  {
    CommandLineInterpreter cli = new CommandLineInterpreter();
    ActionCallingContext acc = new ActionCallingContext();

    acc.AddParameter("Name", "XGedIaFormatText");
    acc.AddParameter("height", "20");

    cli.Execute("XGedStartInteractionAction", acc);

    return;
  }
}


04 Action überladen
using Eplan.EplApi.ApplicationFramework;
using Eplan.EplApi.Scripting;

public class _02_Actions_ausfuehren_04_Action_ueberladen
{
  [DeclareAction("XGedUpdateMacroAction", 50)]
  public void Function()
  {
    ActionCallingContext acc = new ActionCallingContext();
    acc.AddParameter("AutoAssignLastUsedRecord", "1");

    Eplan.EplApi.ApplicationFramework.Action action =
      new ActionManager().FindBaseActionFromFunctionAction(false);
    action.Execute(acc);

    return;
  }
}