*Set Var nMonitor=0
*Intformat "%i"
*Set Var IntervalNumber=0
*loop Intervals
*If(IntvData(Interval_Is_Active,real)==1)
*Set Var IntervalNumber=Operation(IntervalNumber+1)
*EndIf
*#//is_active *IntvData(Interval_Is_Active,real), IntervalNumber=*IntervalNumber
*Set Cond Monitor_for_Point   *nodes  *CanRepeat
*#Add Cond Monitor_for_Line    *nodes  *CanRepeat
*Add Cond Monitor_for_Surface *nodes  *CanRepeat
*If(ndime==3)
*Add Cond Monitor_for_Volume  *nodes  *CanRepeat
*EndIf
*If(CondNumEntities(Int)>0)
*# // selection has *CondNumEntities entities
*loop nodes *OnlyInCond
*#
*If(Cond(Dir-X,Int)==1 || Cond(Humidity,Int)==1 || Cond(Dir-Y,Int)==1 || Cond(Temperature,Int)==1 || Cond(Dir-Z,Int)==1 || Cond(Moisture_Content,Int)==1 || Cond(Comp-4,Int)==1 || Cond(Comp-5,Int)==1 || Cond(Comp-6,Int)==1)
*Set Var nMonitor=Operation(nMonitor+1)
Output Name "*Cond(MonitorName)_|*NodesNum|_*tcl(OutputParser *Cond(Output_Data)) #*Cond(Dir-X,Int)*Cond(Humidity,Int)*Cond(Dir-Y,Int)*Cond(Temperature,Int)*Cond(Dir-Z,Int)*Cond(Moisture_Content,Int)" *\
*If(Cond(Draw_Each_Iteration,Int)==1)
MONITOR_1 EACH ITERATION *\
*Else
MONITOR_2 *\
*EndIf
 LOCATION NODES NODE AT *NodesNum DATA List *\
*EndIf
*#
*If(Cond(Dir-X,Int)==1 || Cond(Humidity,Int)==1)
 "*tcl(OutputParser *Cond(Output_Data))" ITEM AT 1 *\
*EndIf
*If(Cond(Dir-Y,Int)==1 || Cond(Temperature,Int)==1)
 "*tcl(OutputParser *Cond(Output_Data))" ITEM AT 2 *\
*EndIf
*If(Cond(Dir-Z,Int)==1 || Cond(Moisture_Content,Int)==1)
 "*tcl(OutputParser *Cond(Output_Data))" ITEM AT 3 *\
*EndIf
*If(Cond(Comp-4,Int)==1)
 "*tcl(OutputParser *Cond(Output_Data))" ITEM AT 4 *\
*EndIf
*If(Cond(Comp-5,Int)==1)
 "*tcl(OutputParser *Cond(Output_Data))" ITEM AT 5 *\
*EndIf
*If(Cond(Comp-6,Int)==1)
 "*tcl(OutputParser *Cond(Output_Data))" ITEM AT 6 *\
*EndIf
*#
*If(Cond(Dir-X,Int)==1 || Cond(Humidity,Int)==1 || Cond(Dir-Y,Int)==1 || Cond(Temperature,Int)==1 || Cond(Dir-Z,Int)==1 || Cond(Moisture_Content,Int)==1 || Cond(Comp-4,Int)==1 || Cond(Comp-5,Int)==1 || Cond(Comp-6,Int)==1)
 End ;
*EndIf
*#
*End nodes
*# // *\
*if(VypsatUpozorneniMonitorOnlyFirstInterval==0 && IntervalNumber!=1)
*set var VypsatUpozorneniMonitorOnlyFirstInterval=1
*EndIf
*EndIf
*break
*End Intervals
*# // End block of Monitors of Output_Data
*# // End of block of Monitors -> number of conditions *nMonitor with block Monitor is *nMonitor
*# // new structure of Line and Reinforcement monitor defined by selection
*Intformat "%i"
*Set Var IntervalNumber=0
*loop Intervals
*If(IntvData(Interval_Is_Active,real)==1)
*Set Var IntervalNumber=Operation(IntervalNumber+1)
*EndIf
*#//is_active *IntvData(Interval_Is_Active,real), IntervalNumber=*IntervalNumber
*Set Cond Monitor_for_Line    *nodes  *CanRepeat
*If(CondNumEntities(Int)>0)
*# // selection has *CondNumEntities entities
*loop nodes *OnlyInCond
*If(Cond(Dir-X,Int)==1 || Cond(Humidity,Int)==1 || Cond(Dir-Y,Int)==1 || Cond(Temperature,Int)==1 || Cond(Dir-Z,Int)==1 || Cond(Moisture_Content,Int)==1 || Cond(Comp-4,Int)==1 || Cond(Comp-5,Int)==1 || Cond(Comp-6,Int)==1)
*Set Var nMonitor=Operation(nMonitor+1)

*realformat " %5g"
// Delete Joint *NodesNum ;
MACRO_JOINT COORDINATES
	*NodesNum *nodescoord
*# // SELECTION "MonitorNode*NodesNum" GENERATE NODE NEAREST MACRO NODES *NodesNum EXECUTE ;
SELECTION "*Cond(MonitorName)*NodesNum" GENERATE NODES WITHIN DISTANCE *Operation(2.0*fabs(GenData(MASTER_SLAVE_DISTANCE,REAL))) FROM Point MACRO NODES *NodesNum EXECUTE ;
*#
Output Name "*Cond(MonitorName)_|*NodesNum|_*tcl(OutputParser *Cond(Output_Data)) #*Cond(Dir-X,Int)*Cond(Humidity,Int)*Cond(Dir-Y,Int)*Cond(Temperature,Int)*Cond(Dir-Z,Int)*Cond(Moisture_Content,Int)" *\
*If(Cond(Draw_Each_Iteration,Int)==1)
MONITOR_1 EACH ITERATION *\
*Else
MONITOR_2 *\
*EndIf
LOCATION NODES NODE AT SELECTION "*Cond(MonitorName)*NodesNum" DATA List *\
*EndIf
*#
*If(Cond(Dir-X,Int)==1 || Cond(Humidity,Int)==1)
 "*tcl(OutputParser *Cond(Output_Data))" ITEM AT 1 *\
*EndIf
*If(Cond(Dir-Y,Int)==1 || Cond(Temperature,Int)==1)
 "*tcl(OutputParser *Cond(Output_Data))" ITEM AT 2 *\
*EndIf
*If(Cond(Dir-Z,Int)==1 || Cond(Moisture_Content,Int)==1)
 "*tcl(OutputParser *Cond(Output_Data))" ITEM AT 3 *\
*EndIf
*If(Cond(Comp-4,Int)==1)
 "*tcl(OutputParser *Cond(Output_Data))" ITEM AT 4 *\
*EndIf
*If(Cond(Comp-5,Int)==1)
 "*tcl(OutputParser *Cond(Output_Data))" ITEM AT 5 *\
*EndIf
*If(Cond(Comp-6,Int)==1)
 "*tcl(OutputParser *Cond(Output_Data))" ITEM AT 6 *\
*EndIf
*#
*If(Cond(Dir-X,Int)==1 || Cond(Humidity,Int)==1 || Cond(Dir-Y,Int)==1 || Cond(Temperature,Int)==1 || Cond(Dir-Z,Int)==1 || Cond(Moisture_Content,Int)==1 || Cond(Comp-4,Int)==1 || Cond(Comp-5,Int)==1 || Cond(Comp-6,Int)==1)
 End ;
*EndIf
*#
*End nodes
*# // *\
*if(VypsatUpozorneniMonitorOnlyFirstInterval==0 && IntervalNumber!=1)
*set var VypsatUpozorneniMonitorOnlyFirstInterval=1
*EndIf
*EndIf
*break
*End Intervals
*#
*#
*#
*#
*#
*#
*#
*#
*Intformat "%i"
*Set Var IntervalNumber=0
*Set Var groupIDold = -1
*tcl(ZJ_Vymaz_temp 0)
*loop Intervals
*If(IntvData(Interval_Is_Active,real)==1)
*Set Var IntervalNumber=Operation(IntervalNumber+1)
*EndIf
*#//is_active *IntvData(Interval_Is_Active,real), IntervalNumber=*IntervalNumber
*Set Cond Monitor_for_Point_Nearest_Node_IP    *nodes  *CanRepeat
*If(CondNumEntities(Int)>0)
*# // selection has *CondNumEntities entities
*loop nodes *OnlyInCond
*If(Cond(Dir-X,Int)==1 || Cond(Humidity,Int)==1 || Cond(Dir-Y,Int)==1 || Cond(Temperature,Int)==1 || Cond(Dir-Z,Int)==1 || Cond(Moisture_Content,Int)==1 || Cond(Comp-4,Int)==1 || Cond(Comp-5,Int)==1 || Cond(Comp-6,Int)==1)
*#include ..\include.src.bas\CurrentElementgroupID.bas
*#Set Var groupID=Operation(ElemsMat*IncrMaterialID+CurrentType)
*# groupIDold=*groupIDold, groupIDold = *groupIDold, GenData(temp) = *GenData(temp), Cond(MonitorName) = *Cond(MonitorName)
*#If(groupID != groupIDold && strcmp(Cond(MonitorName),GenData(temp))!=0) 
*# 
*#Set Var groupIDold = groupID
*#tcl(ZJ_Uloz_temp *Cond(MonitorName))
*Set Var nMonitor=Operation(nMonitor+1)
*Set Var nPointNumber = Operation(nMonitor+985000)
*realformat " %5g"
*# // new monitor group = *groupID;



MACRO_JOINT COORDINATES *nPointNumber *NodesCoord
SELECTION "*Cond(Nearest)_NEAREST_*nPointNumber" GENERATE *\
*If(strcmp(Cond(Nearest),"IP")==0)
IPS *\
*Else
GNODE *\
*EndIf
NEAREST MACRO NODES *nPointNumber *\
*If(strcmp(Cond(Nearest),"IP")==0 || strcmp(Cond(Nearest),"GNODE")==0 || strcmp(Cond(Nearest),"NODE")==0)
*If(strcmp(Cond(Element_type),"SOLID")==0)
*If(oMinIndexElemGroups<oMaxIndexElemGroups)
*If(oMinIndexElemGroups(int)==90000)
*MessageBox error: MinimalElementGroup is 90000. Probably you dont have any solid element
*EndIf
*If(oMaxIndexElemGroups(int)==0)
*MessageBox error: MaximalElementGroup is 0. Probably you dont have any solid element
*EndIf
*If(Cond(Find_Only_In_Material,Int)==1) 
/** min max for *Cond(Only_In_Material) **/ *\
*#/** min *Cond(Only_In_Material) *tcl(TK_WriteMinGroupIDVSMaterial *Cond(Only_In_Material) *oMinIndexElemGroups) **/ *\
GROUP_FROM *tcl(TK_WriteMinGroupIDVSMaterial *Cond(Only_In_Material) *oMinIndexElemGroups) *\
*Else
GROUP_FROM *oMinIndexElemGroups *\
*EndIf
*If(Cond(Find_Only_In_Material,Int)==1) 
*#/** max *Cond(Only_In_Material) *tcl(TK_WriteMaxGroupIDVSMaterial *Cond(Only_In_Material) *oMaxIndexElemGroups) **/ *\
GROUP_TO *tcl(TK_WriteMaxGroupIDVSMaterial *Cond(Only_In_Material) *oMaxIndexElemGroups) *\
*Else
GROUP_TO *oMaxIndexElemGroups *\
*EndIf
*Else
*If(oMinIndexElemGroups(int)==90000)
*MessageBox error: MinimalElementGroup is 90000. Probably you dont have any solid element
*EndIf
GROUP *oMinIndexElemGroups *\
*EndIf
*ElseIf(strcmp(Cond(Element_type),"REINFORCEMENT")==0)
*If(oMinReinfGroups<oMaxReinfGroups)
*If(oMinReinfGroups(int)==2000000000)
*MessageBox error: MinimalReinforcementGroup is 2000000000. Probably you dont have any reinforcement element
*EndIf
*If(oMaxReinfGroups(int)==-1)
*MessageBox error: MaximalReinforcementGroup is -1. Probably you dont have any reinforcement element
*EndIf
GROUP_FROM *oMinReinfGroups GROUP_TO *oMaxReinfGroups *\
*Else
*If(oMaxReinfGroups(int)==-1)
*MessageBox error: MaximalReinforcementGroup is -1. Probably you dont have any reinforcement element
*EndIf
GROUP *oMaxReinfGroups *\
*EndIf
*EndIf
*# oMaxReinfGroups oMinReinfGroups
*EndIf
EXECUTE 
*# SELECTION "*Cond(MonitorName)*NodesNum" GENERATE NODES WITHIN DISTANCE *Operation(2.0*fabs(GenData(MASTER_SLAVE_DISTANCE,REAL))) FROM Point MACRO NODES *NodesNum EXECUTE ;
*#
Output Name "*Cond(MonitorName)_|*NodesNum|_*\
*If(strcmp(Cond(Nearest),"IP")==0)
*tcl(OutputParser *Cond(Output_Data_IP))*\
*ElseIf(strcmp(Cond(Nearest),"GNODE")==0)
*tcl(OutputParser *Cond(Output_Data_GNODE))*\
*Else
*tcl(OutputParser *Cond(Output_Data_NODE))*\
*EndIf
 #*Cond(Dir-X,Int)*Cond(Humidity,Int)*Cond(Dir-Y,Int)*Cond(Temperature,Int)*Cond(Dir-Z,Int)*Cond(Moisture_Content,Int)" *\
*If(Cond(Draw_Each_Iteration,Int)==1)
MONITOR_1 EACH ITERATION *\
*Else
MONITOR_2 *\
*EndIf
LOCATION *\
*If(strcmp(Cond(Nearest),"IP")==0)
ELEMENT_IPS *\
*Else
NODES *\
*EndIf

MULTI_SELECTION AT "*Cond(Nearest)_NEAREST_*nPointNumber" DATA List *\
*#
*If(Cond(Dir-X,Int)==1 || Cond(Humidity,Int)==1)
*If(strcmp(Cond(Nearest),"IP")==0 && strcmp(Cond(Output_Data_IP),"ELEM_TOTAL_TEMPERATURE")!=0)
 "*tcl(OutputParser *Cond(Output_Data_IP))" ITEM AT 1 *\
*ElseIf(strcmp(Cond(Nearest),"IP")==0 && strcmp(Cond(Output_Data_IP),"ELEM_TOTAL_TEMPERATURE")==0)
 "*tcl(OutputParser *Cond(Output_Data_IP))" ITEM AT 15 *\
*ElseIf(strcmp(Cond(Nearest),"GNODE")==0)
 "*tcl(OutputParser *Cond(Output_Data_GNODE))" ITEM AT 1 *\
*Else
 "*tcl(OutputParser *Cond(Output_Data_NODE))" ITEM AT 1 *\
*EndIf
*EndIf
*If(Cond(Dir-Y,Int)==1 || Cond(Temperature,Int)==1)
*If(strcmp(Cond(Nearest),"IP")==0)
 "*tcl(OutputParser *Cond(Output_Data_IP))" ITEM AT 2 *\
*ElseIf(strcmp(Cond(Nearest),"GNODE")==0)
 "*tcl(OutputParser *Cond(Output_Data_GNODE))" ITEM AT 2 *\
*Else
 "*tcl(OutputParser *Cond(Output_Data_NODE))" ITEM AT 2 *\
*EndIf
*EndIf
*If(Cond(Dir-Z,Int)==1 || Cond(Moisture_Content,Int)==1)
*If(strcmp(Cond(Nearest),"IP")==0)
 "*tcl(OutputParser *Cond(Output_Data_IP))" ITEM AT 3 *\
*ElseIf(strcmp(Cond(Nearest),"GNODE")==0)
 "*tcl(OutputParser *Cond(Output_Data_GNODE))" ITEM AT 3 *\
*Else
 "*tcl(OutputParser *Cond(Output_Data_NODE))" ITEM AT 3 *\
*EndIf
*EndIf
*If(Cond(Comp-4,Int)==1)
*If(strcmp(Cond(Nearest),"IP")==0)
 "*tcl(OutputParser *Cond(Output_Data_IP))" ITEM AT 4 *\
*ElseIf(strcmp(Cond(Nearest),"GNODE")==0)
 "*tcl(OutputParser *Cond(Output_Data_GNODE))" ITEM AT 4 *\
*Else
 "*tcl(OutputParser *Cond(Output_Data_NODE))" ITEM AT 4 *\
*EndIf
*EndIf
*If(Cond(Comp-5,Int)==1)
*If(strcmp(Cond(Nearest),"IP")==0)
 "*tcl(OutputParser *Cond(Output_Data_IP))" ITEM AT 5 *\
*ElseIf(strcmp(Cond(Nearest),"GNODE")==0)
 "*tcl(OutputParser *Cond(Output_Data_GNODE))" ITEM AT 5 *\
*Else
 "*tcl(OutputParser *Cond(Output_Data_NODE))" ITEM AT 5 *\
*EndIf
*EndIf
*If(Cond(Comp-6,Int)==1)
*If(strcmp(Cond(Nearest),"IP")==0)
 "*tcl(OutputParser *Cond(Output_Data_IP))" ITEM AT 6 *\
*ElseIf(strcmp(Cond(Nearest),"GNODE")==0)
 "*tcl(OutputParser *Cond(Output_Data_GNODE))" ITEM AT 6 *\
*Else
 "*tcl(OutputParser *Cond(Output_Data_NODE))" ITEM AT 6 *\
*EndIf
*EndIf
*#
*If(Cond(Dir-X,Int)==1 || Cond(Humidity,Int)==1 || Cond(Dir-Y,Int)==1 || Cond(Temperature,Int)==1 || Cond(Dir-Z,Int)==1 || Cond(Moisture_Content,Int)==1 || Cond(Comp-4,Int)==1 || Cond(Comp-5,Int)==1 || Cond(Comp-6,Int)==1)
 End ;
*EndIf  
*#EndIf
*EndIf
*#
*End nodes
*# // *\
*if(VypsatUpozorneniMonitorOnlyFirstInterval==0 && IntervalNumber!=1)
*set var VypsatUpozorneniMonitorOnlyFirstInterval=1
*EndIf
*EndIf
*break
*End Intervals
*#
*#
*#
*#
*#
*#
*if(VypsatUpozorneniMonitorOnlyFirstInterval==1)
*WarningBox Error: You can only define Monitors in the first Interval. You have some monitors defined in intervals # > 1.
*set var VypsatUpozorneniMonitorOnlyFirstInterval=2
*EndIf
*# // End block of Monitors of Output_Data
*# // End of block of Monitors -> number of conditions *nMonitor with block Monitor is *nMonitor
