How do I run an ACT extension specific command in the general WB Scripting Console?
![Ayush Kumar](https://us.v-cdn.net/6037473/uploads/userpics/RGJ3E8O4WFAG/n98CYBYJ7H6ZS.jpg)
Ayush Kumar
Member, Moderator, Employee Posts: 427
✭✭✭✭
![Ansys Employee](https://us.v-cdn.net/6037473/uploads/badges/RVRDV39KPJ91.png)
![Solution Developer Community of Practice Member](https://us.v-cdn.net/6037473/uploads/badges/274G8C56SBE6.png)
How can I call any extension specific functions in the general WB scripting console?
For example, I have an extension called "FutureERA" and to call functions specific to that extension I can manually switch scoping to "FutureERA" and call the methods. Is there a way to do it without switching the scope? This is needed if one wants to call methods in WB Console from Mechanical Console using wbjn.ExecuteCommands
.
Tagged:
0
Answers
-
You can do that by retrieving the extension in the general WB Console and use the
ExecuteCommand
function of the extension. For example, if you want to call an extension specific method -MyMethod
in the WB console from Mechanical console you need to useExecuteCommand
on two levels:cmd = """ fera = ExtAPI.ExtensionManager.GetExtensionByName('FutureERA') fera.ExecuteCommand('MyMethod(Arg1, Arg2)') """ import wbjn wbjn.ExecuteCommand(ExtAPI, cmd)
2