Visual Components' Community

New Thinking for Factory Simulation
Welcome to Visual Components' Community Sign in | Help
in Search

Control Statistic behaviour with a sript

Last post ke, elo 27 2008 15:08 by RicardoVelez. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • ke, elo 27 2008 15:08

    Control Statistic behaviour with a sript

    To change the states of a Statistics behaviour, we need to use a python script. These statistics states are then usable from Tools menu > Show Statistics or Export Statistics (to a CSV file).

    There are several ready states but user can create on states as well.

    To change a state, just get the handle for the statistic behaviour and then set the state as a string. There is a short example of how to change the states to "Idle", "Processing" or "Busy".

    comp= getComponent()
    stats= comp.findBehaviour("Statistics")

    stats.State= "Idle"

    stats.State= "Processing"

    stats.State= "Busy"

     

    Ricardo Velez
    Research and Development Manager
    Filed under: ,
Page 1 of 1 (1 items)