getInstancesViewSelection only returns the first selected

Viewing 2 posts - 1 through 2 (of 2 total)
  • 1st April 2016 at 8:02 pm #14570

    Using this example from the documents, selecting more than one instance (for example 3) returns 3 copies of the same instance such as 1,1,1 instead of 1,2,3.

    import MConsoleAPI
    err, list = MConsoleAPI.getInstancesViewSelection()
    if (err.getErrorCode() != 0): sys.exit(err.getDescription())
    for nodeId in list:
    err, nodeObj = MConsoleAPI.nodeGet(nodeId)
    if (err.getErrorCode() ==0): print(“Selected instance: ” + nodeObj.getInstanceName())

    My code here:

    import MConsoleAPI

    err, list = MConsoleAPI.getInstancesViewSelection()
    if (err.getErrorCode() != 0): sys.exit(err.getDescription())
    print(list)
    for nodeId in list:
    print(nodeId)
    err, nodeObj = MConsoleAPI.nodeGet(nodeId)
    print(“Selected instance: ” + nodeObj.getInstanceName())
    ramUsage = nodeObj.getRamUsage()
    splitRamUsage = ramUsage.split()
    print(splitRamUsage[0])

    Will return the first instance selected for every instance selected.

    19th February 2018 at 1:35 pm #16655

    This is a bug and has been fixed in the latest releases

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.