Simul8 Tips, Technical Corner

Remember the current Work Item

(Relevant for advanced SIMUL8 users)

When working on a simulation, there may be some instances when some of the code you write changes the focus of your Work Item. Commands such as ‘copy current Work Item to queue’, ‘Add work to queue’ and ‘Select current Work Item’ change the focus of your Work Item. If that is the case, you may need to return to the original Work Item for additional logic.There is a very simple and fast way of doing so in SIMUL8.

  • Create a variable (of type number), e.g. gblWorkItem
  • Remember the original work item using the following command ‘SET gblWorkItem = Current Work Item’
  • Typing ‘Current work item’ is a special command that will return a unique number that identifies the currently selected Work Item
  • So if you then run some logic that changes the focus of your work item (i.e. unselects that Work Item) then simply run the inverse command to change the focus back to the original work item: ‘SET Current Work Item = gblWorkItem’

 

About the author

Simul8

Simul8

For over 20 years we've been working with organizations around the world to transform processes. Our intuitive software is relied on to help make million dollar decisions. From Ford to NASA, Geisinger to Boston Scientific, SIMUL8 Corporation's powerful software is being used to increase efficiency, reduce costs and improve processes.