do( var([strFile], vbString), var([strDir], vbString), var([atmLayer], vbAtom), var([strLine], vbString), var([valCol], vbValue), var([valRep], vbValue), var([valRow], vbValue), {**Loop over all scenerios enabled in the experiment wizard**} Repeat( nRows(atm_EW), if( CellAsValue(Count, 8, atm_EW), do( {**Loop over replications**} valRow := Count, Repeat( CellAsValue(valRow, 4, atm_EW) - CellAsValue(valRow, 9, atm_EW) + 1, do( valRep := CellAsValue(valRow, 9, atm_EW) + Count - 1, {** Load Output**} PD_OUTPUT_RESET, PD_OUTPUT_FREELIBRARY, PD_OUTPUT_LOADLIBRARY, strDir := Concat(CellAsString(valRow, 2, atm_EW), CellAsString(valRow, 1, atm_EW), [\Rep], string(valRep)), PD_Output_LoadFromDirectory(strDir), strFile := Concat(strDir, [\FlowCounters.txt]), FileOpen(strFile), FileClear, ForAtomLayerUnder( atmPDOutput, do( atmLayer := a, if( M(atmLayer) = atmMotherOutputLayer, {**Loop over all flow counters in the layer**} List_ForAllItemsInList( OutputLayer_GetlstFlowCounters(atmLayer), do( {**Get the output**} FlowCounter_ShowGraph(s, 2), {**Write name of layer flow counter**} strLine := Concat(Name(Rank(OutputLayer_GetLayerID(atmLayer), PDEnvAtom)), [;], name(s), [;]), FileTextWrite(strLine), Repeat( nCols(s), do( valCol := Count, case( Count, strLine := [Time (s);], strLine := [Left to Right;], strLine := [Right to Left;] ), Repeat( nRows(s), strLine := Concat(strLine,CellAsString(Count, valCol, s),[;]) ), FileTextWrite(strLine) ) ) ) ) ) ) ), FileClose ) ) ) ) ) )