EBDN - Community - Question & Answers

  Friday, 15 March 2019
  2 Replies
  1.2K Visits
0
Votes
Undo
Hi,

How can I run one Macro through other Macro using c#?
I tried these API


  • myApplication.Utils.RunMacroOrPlugIn("TESTWPF", root); inside public override void Run(Aucotec.EngineeringBase.Client.Runtime.Application myApplication)

  • Second option I tried as separate stand alone application with c# code as

Application eb = new Application();
eb.Utils.RunMacro("TESTWPF", null);



both raise exception as
"Error with the execution of a macro or wizard"

Aucotec.EngineeringBase.Client.MacroPlugInRunException was unhandled by user code
HResult=-2147194545
Message=Error with the execution of a macro or wizard
Source=Aucotec.EngineeringBase.Client.RuntimeHostAdapter
AucotecResult=-2147194545
StackTrace:
Server stack trace:
at Aucotec.EngineeringBase.Client.RuntimeHostAdapter.UtilsHostAdapterViewToContract.RunMacroOrPlugIn(String macroName, IObjectItem startObject)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Aucotec.EngineeringBase.Client.RuntimeContract.IUtils.RunMacroOrPlugIn(String macroName, IObjectItem startObject)
at Aucotec.EngineeringBase.Client.RuntimeAddInAdapter.UtilsAddInAdapterContractToView.RunMacroOrPlugIn(String macroName, ObjectItem startObject)
at WireInfoUpdater.MyPlugIn.Run(Application myApplication)
at Aucotec.EngineeringBase.Client.RuntimeAddInAdapter.PlugInWizardAddInAdapterViewToContract.Run_Internal(Object app)
InnerException:

Please help me the solution.

Thanks
Neeraj Kumar