*# ApplyInSubIncrement is Option For Creep code
*#
*If(CondNumEntities(Int)>0)
      // selection has *CondNumEntities entities
*# LOAD CASE ID *nSupport NAME "Supports for Load Step #*nSupport"
*loop nodes *OnlyInCond
*#
*# Cond(Apply_in_Subincrement,int)=*Cond(Apply_in_Subincrement,int) ApplyInSubincrement=*ApplyInSubincrement
*If(Cond(Apply_in_Subincrement,int)==ApplyInSubincrement  || strcmp(GenData(Calculation_Analysis),"Static")==0) 
*#
*# Cond(Coordinate_System)
*If(strcmp(Cond(Coordinate_System),"GLOBAL")==0)
*#
*If(Cond(X-Constraint,Int)==1)
SUPPORT SIMPLE node *NodesNum dof 1 /** *Cond(Coordinate_System) **/ VALUE 0.0
*Set Var nSupport=Operation(nSupport+1)
*EndIf
*If(Cond(Y-Constraint,Int)==1)
SUPPORT SIMPLE node *NodesNum dof 2 /** *Cond(Coordinate_System) **/ VALUE 0.0
*Set Var nSupport=Operation(nSupport+1)
*EndIf
*If(Cond(Z-Constraint,Int)==1)
SUPPORT SIMPLE node *NodesNum dof 3 /** *Cond(Coordinate_System) **/ VALUE 0.0
*Set Var nSupport=Operation(nSupport+1)
*EndIf
*#
*ElseIf(strcmp(Cond(Coordinate_System),"INCLINED")==0)
*# Cond(Multiplier_for_Dof_1_f1,Real)
*# Operation(1.0*fabs(Cond(Multiplier_for_Dof_1_f1,Real)))
*If(Cond(Slave_dof,Int)==1)
*If(Cond(Multiplier_for_Dof_2_f2,Real)==0.0 && Cond(Multiplier_for_Dof_3_f3,Real)==0)
*tcl(TK_CTRLclear)*\
*tcl(TK_CTRLc "Error: Inclined support for node number " *NodesNum " has both zero multipliers")*\
*tcl(TK_TK_WarnWinTextTK_CTRLv)*\
*EndIf
*EndIf
*#
*If(Cond(Slave_dof,Int)==2)
*If(Cond(Multiplier_for_Dof_1_f1,Real)==0.0 && Cond(Multiplier_for_Dof_3_f3,Real)==0)
*tcl(TK_CTRLclear)*\
*tcl(TK_CTRLc "Error: Inclined support for node number " *NodesNum " has both zero multipliers")*\
*tcl(TK_TK_WarnWinTextTK_CTRLv)*\
*EndIf
*EndIf
*#
*If(Cond(Slave_dof,Int)==3)
*If(Cond(Multiplier_for_Dof_2_f2,Real)==0.0 && Cond(Multiplier_for_Dof_1_f1,Real)==0)
*tcl(TK_CTRLclear)*\
*tcl(TK_CTRLc "Error: Inclined support for node number " *NodesNum " has both zero multipliers")*\
*tcl(TK_TK_WarnWinTextTK_CTRLv)*\
*EndIf
*EndIf
*#
*# // If Coordinate system is LOCAL
*Set Var omaxabsvals=Operation(1.0*fabs(Cond(Multiplier_for_Dof_1_f1,Real)))
*Set Var omaxabsvals2=Operation(1.0*(Cond(Multiplier_for_Dof_1_f1,Real)))
*If(omaxabsvals>0.0)
*Set Var multipls=Operation(1.0/omaxabsvals)
*Set Var multipls2=Operation(1.0/omaxabsvals2)
*Set Var omaxabsdofs=1
*EndIf
*#
*If(omaxabsvals<Operation(1.0*fabs(Cond(Multiplier_for_Dof_2_f2,Real))))
*Set Var omaxabsvals=Operation(1.0*fabs(Cond(Multiplier_for_Dof_2_f2,Real)))
*Set Var omaxabsvals2=Operation(1.0*(Cond(Multiplier_for_Dof_2_f2,Real)))
*Set Var multipls=Operation(1.0/omaxabsvals)
*Set Var multipls2=Operation(1.0/omaxabsvals2)
*Set Var omaxabsdofs=2
*EndIf
*If(omaxabsvals<Operation(1.0*fabs(Cond(Multiplier_for_Dof_3_f3,Real))))
*Set Var omaxabsvals=Operation(1.0*fabs(Cond(Multiplier_for_Dof_3_f3,Real)))
*Set Var omaxabsvals2=Operation(1.0*(Cond(Multiplier_for_Dof_3_f3,Real)))
*Set Var multipls=Operation(1.0/omaxabsvals)
*Set Var multipls2=Operation(1.0/omaxabsvals2)
*Set Var omaxabsdofs=3
*EndIf
*#
*If(omaxabsdofs==1)
SUPPORT COMPLEX master node *\
*If(Cond(Multiplier_for_Dof_2_f2,Real)!=0.0 && Cond(Multiplier_for_Dof_2_f2,Real)!=0)
 *NodesNum DOF 2 ** *Operation(multipls2*Cond(Multiplier_for_Dof_2_f2,Real)) *\
*EndIf
*If(Cond(Multiplier_for_Dof_3_f3,Real)!=0.0 && Cond(Multiplier_for_Dof_3_f3,Real)!=0)
 *NodesNum DOF 3 ** *Operation(multipls2*Cond(Multiplier_for_Dof_3_f3,Real)) *\ 
*EndIf
slave node *NodesNum dof 1 VALUE  0.0
*Set Var nSupport=Operation(nSupport+1)
*ElseIf(omaxabsdofs==2)
SUPPORT COMPLEX master node *\
*If(Cond(Multiplier_for_Dof_1_f1,Real)!=0.0 && Cond(Multiplier_for_Dof_1_f1,Real)!=0)
 *NodesNum DOF 1 ** *Operation(multipls2*Cond(Multiplier_for_Dof_1_f1,Real)) *\
*EndIf
*If(Cond(Multiplier_for_Dof_3_f3,Real)!=0.0 && Cond(Multiplier_for_Dof_3_f3,Real)!=0)
 *NodesNum DOF 3 ** *Operation(multipls2*Cond(Multiplier_for_Dof_3_f3,Real)) *\
*EndIf
slave node *NodesNum dof 2 VALUE  0.0
*Set Var nSupport=Operation(nSupport+1)
*ElseIf(omaxabsdofs==3)
SUPPORT COMPLEX master node *\
*If(Cond(Multiplier_for_Dof_1_f1,Real)!=0.0 && Cond(Multiplier_for_Dof_1_f1,Real)!=0)
 *NodesNum DOF 1 ** *Operation(multipls2*Cond(Multiplier_for_Dof_1_f1,Real)) *\
*EndIf
*If(Cond(Multiplier_for_Dof_2_f2,Real)!=0.0 && Cond(Multiplier_for_Dof_2_f2,Real)!=0)
 *NodesNum DOF 2 ** *Operation(multipls2*Cond(Multiplier_for_Dof_2_f2,Real)) *\
*EndIf
slave node *NodesNum dof 3 VALUE  0.0
*Set Var nSupport=Operation(nSupport+1)
*EndIf
*#
*ElseIf(strcmp(Cond(Coordinate_System),"INCLINED_LINE")==0)
*# Cond(Multiplier_for_Dof_1_f1,Real)
*# Operation(1.0*fabs(Cond(Multiplier_for_Dof_1_f1,Real)))
*#
*# // If Coordinate system is LOCAL LINE
*If(Cond(Master_dof,Int)==1)
*If(Cond(Line_Multiplier_for_Dof_2_f2,Real)==0.0 && Cond(Line_Multiplier_for_Dof_3_f3,Real)==0)
*tcl(TK_CTRLclear)*\
*tcl(TK_CTRLc "Error: Inclined line support for node number " *NodesNum " has both zero multipliers")*\
*tcl(TK_TK_WarnWinTextTK_CTRLv)*\
*EndIf
*EndIf
*#
*If(Cond(Master_dof,Int)==2)
*If(Cond(Line_Multiplier_for_Dof_1_f1,Real)==0.0 && Cond(Line_Multiplier_for_Dof_3_f3,Real)==0)
*tcl(TK_CTRLclear)*\
*tcl(TK_CTRLc "Error: Inclined line support for node number " *NodesNum " has both zero multipliers")*\
*tcl(TK_TK_WarnWinTextTK_CTRLv)*\
*EndIf
*EndIf
*#
*If(Cond(Master_dof,Int)==3)
*If(Cond(Line_Multiplier_for_Dof_2_f2,Real)==0.0 && Cond(Line_Multiplier_for_Dof_1_f1,Real)==0)
*tcl(TK_CTRLclear)*\
*tcl(TK_CTRLc "Error: Inclined line support for node number " *NodesNum " has both zero multipliers")*\
*tcl(TK_TK_WarnWinTextTK_CTRLv)*\
*EndIf
*EndIf
*#                   
*If(Cond(Master_dof,Int)==1)
SUPPORT COMPLEX master node *NodesNum DOF 1 ** *Operation(-1.0*Cond(Line_Multiplier_for_Dof_2_f2,Real)/Cond(Line_Multiplier_for_Dof_1_f1,Real)) slave node *NodesNum dof 2 VALUE  0.0
SUPPORT COMPLEX master node *NodesNum DOF 1 ** *Operation(-1.0*Cond(Line_Multiplier_for_Dof_3_f3,Real)/Cond(Line_Multiplier_for_Dof_1_f1,Real)) slave node *NodesNum dof 3 VALUE  0.0
*Set Var nSupport=Operation(nSupport+1)
*ElseIf(Cond(Master_dof,Int)==2)
SUPPORT COMPLEX master node *NodesNum DOF 2 ** *Operation(-1.0*Cond(Line_Multiplier_for_Dof_1_f1,Real)/Cond(Line_Multiplier_for_Dof_2_f2,Real)) slave node *NodesNum dof 1 VALUE  0.0
SUPPORT COMPLEX master node *NodesNum DOF 2 ** *Operation(-1.0*Cond(Line_Multiplier_for_Dof_3_f3,Real)/Cond(Line_Multiplier_for_Dof_2_f2,Real)) slave node *NodesNum dof 3 VALUE  0.0
*Set Var nSupport=Operation(nSupport+1)
*ElseIf(Cond(Master_dof,Int)==3)
SUPPORT COMPLEX master node *NodesNum DOF 3 ** *Operation(-1.0*Cond(Line_Multiplier_for_Dof_1_f1,Real)/Cond(Line_Multiplier_for_Dof_3_f3,Real)) slave node *NodesNum dof 1 VALUE  0.0
SUPPORT COMPLEX master node *NodesNum DOF 3 ** *Operation(-1.0*Cond(Line_Multiplier_for_Dof_2_f2,Real)/Cond(Line_Multiplier_for_Dof_3_f3,Real)) slave node *NodesNum dof 2 VALUE  0.0
*Set Var nSupport=Operation(nSupport+1)
*EndIf
*#
*Else
 // error in condition Constraint_for_* in question Coordinate_System
*EndIf
*#
*EndIf
*#
*End nodes
*EndIf
