Can someone here help explain to me why this groovy macro code is not returning any values when run on an instance?
I get back an SimulationResult from the .execute(parent, true) operation, but the .getOutputValues() method always returns an empty map.
The Simulation API is really sparsely documented.
Browser browser = Application.getInstance().getMainFrame().getBrowser() // Get the Browser Object
BrowserTabTree activeTree = browser.getActiveTree() // Use that to get the active Tree
SimulationManager simMan = new SimulationManager()
for(node in activeTree.getSelectedNodes()) { // for each selected item in the tree
parent = node.getUserObject() // Get the user object (not the tree reference object)
WriteLine("SimElement: " + parent.getName())
SimulationResult result = simMan.execute(parent, true)
values = result.getOutputValues()
writeMap(values)
}
def void writeMap(Map inMap) {
for(key in inMap.keySet()) {
WriteLine(key.toString() + " : " + inMap.get(key).getName())
}
}
// WriteLine
// Utility function to simplify writing text to the notification window
def WriteLine(String msg) {
Application.getInstance().getGUILog().log(msg)
}