*# pro ElemsMatProp(Embedded_Reinforcement,Int) == 1
*#
*If(AddTranspAnalysis==0)
// begin block of Cables and Trusses
*Set Var Cables=1
*Set Var nCables=1
*Set Var CurrentType=0
*Set Var ReinfGroupID=0
*Set Var lastReinfGroupID=-1
*Set Var nrods=nelem(Linear)
*#tcl(ZJ_WriteTime Začátek)*\
*#
*#  testing of assignation condition to generated 1D elements
*#
*Set Cond Reinforcement_Elems_Identification *elems 
*If(CondNumEntities(Int)!=nelem(Linear))
*#// meli by byt stejne pocty vyztuzi a pocet prirazenych podminek REI 
*#// *CondNumEntities(Int) *nelem(Linear)
*#WarningBox Info:  Some Reinforcements #*nelem(Linear) have not assignate condition #*CondNumEntities(Int) For identification - Reinforcement_Elem_Identification (Line condition)
*#MessageBox error: Some Reinforcements #*nelem(Linear) have not assignate condition #*CondNumEntities(Int) For identification - Reinforcement_Elem_Identification (Line condition)
*tcl(TK_CTRLclear)*\
*tcl(TK_CTRLc "Warning: There are Line elements not identified as Reinforcement. \nWarning: The meshed non-reinforcement line(s) may be material spring(s) or lines which should not be meshed \nWarning: (if so you probably get a warning about elements without material just next) - please check. \n " " ")*\
*#tcl(TK_CTRLc "Info: Some Reinforcements have not assign condition for identification - Reinforcement_Elem_Identification (Line condition). Sum of linear elements = " *nelem(Linear) " Sum line with this condition = " *CondNumEntities(Int))*\
*tcl(TK_TK_WarnWinTextTK_CTRLv)*\
*EndIf
*#
*#tcl(ZJ_WriteTime 1)*\
*#  begin of MACRO_JOINTS
*#          && IntervalIndex==1
*If(nrods>0)
*Set Cond Reinforcement_Nodes_Identification *nodes  
*If(CondNumEntities(Int)>0)
// selection has *CondNumEntities entities
*realformat " %5g"
*If(Vypsanimacrojointu==0)
MACRO_JOINT COORDINATES
*loop nodes *OnlyInCond
  *NodesNum *NodesCoord
*Set Var Vypsanimacrojointu=Operation(0+1)
*End nodes
*EndIf
*EndIf
*EndIf
*#
*#  begin of 1D elements in one GENERATE BAR&CABLE REINF
*#tcl(ZJ_WriteTime 2)*\
*#
*Set Cond Reinforcement_Elems_Identification *elems 
*If(CondNumEntities(Int)>0)
*loop elems *OnlyInCond             
*If(strcmp(ElemsMatProp(Material_Prototype),"CCSteelDRC")!=0 && strcmp(ElemsMatProp(Material_Prototype),"CC1DElastIsotropic")!=0 && strcmp(ElemsMatProp(Material_Prototype),"CCReinforcement")!=0 && strcmp(ElemsMatProp(Material_Prototype),"CCCyclingReinforcement")!=0 && strcmp(ElemsMatProp(Material_Prototype),"CCReinforcementWithTempDepProperties")!=0  && strcmp(ElemsMatProp(Material_Prototype),"CCBeam3DMaterial")!=0 && strcmp(ElemsMatProp(Material_Prototype),"CCDummyMaterial")!=0 && strcmp(ElemsMatProp(Material_Prototype),"CCSpringMaterial")!=0)
// The Material *ElemsMatProp(Material_Prototype) can`t use For Line-Reinforcement
*MessageBox error: The Material *ElemsMatProp(Material_Prototype) can`t use For Line-Reinforcement
*ElseIf(strcmp(ElemsMatProp(Material_Prototype),"CCBeam3DMaterial")!=0 && strcmp(ElemsMatProp(Material_Prototype),"CCDummyMaterial")!=0 && strcmp(ElemsMatProp(Material_Prototype),"CCSpringMaterial")!=0)
*#
*Set Var lineNum=Cond(Entity_number,Int)
*#
*If(ElemsMatProp(Embedded_Reinforcement,Int)==0)
*#
*If(strcmp(ElemsMatProp(Geometrical_Non-Linearity),"LINEAR")==0)
*Set Var CurrentType=Operation(ElemsNnode*1)
*Else
*Set Var CurrentType=Operation(ElemsNnode+AddingNonLinElemID)
*EndIf
*Set Var ReinfGroupID=Operation(ElemsMat*IncrMaterialID+CurrentType)
*#
*Else
*Set Var ReinfGroupID=Operation(InitCablesID+Cond(Entity_number,Int))
*EndIf
*#
*If(ReinfGroupID!=lastReinfGroupID)
*Set Var assignmat=0
*#
*If(ElemsMat(Int)<=0)
// For reinforcement bar *elemsnum no material has been assigned. ElemMat: *ElemsMat
*ElemsNum *Cond(Entity_number,Int) *ElemsMat
*tcl(TK_Signal *ElemsNum)
*MessageBox error: For some reinforcement bars no material has been assigned. See the input file for more details.
*EndIf
*#
*Set Var assignmat=1
*#
*If(ElemsMatProp(Embedded_Reinforcement,Int)==1 && ElemsMatProp(Application_from_Interval,Int)==IntervalIndex)
*#If(IntervalIndex==1)
 ;
 ELEMENT TYPE ID *ReinfGroupID Name "*ElemsMatProp(Name)*Cond(Entity_number,Int)" TYPE "*ElemsMatProp(Elem_Type)*\
*If(IsQuadratic(int)==0 && strcmp(ElemsMatProp(Geom_Type),"NORMAL")==0 || strcmp(ElemsMatProp(Geom_Type),"TRUSS")==0)
<xx>"*\
*ElseIf(IsQuadratic(int)==1 && strcmp(ElemsMatProp(Geom_Type),"NORMAL")==0 || strcmp(ElemsMatProp(Geom_Type),"TRUSS")==0)
<xx>"*\ 
*# /** zatim neaktivujeme <xxx> **/ *\
*Else
" *\
*EndIf
 *ElemsMatProp(Geometrical_Non-Linearity) ;
*# // *IsQuadratic(int) *ElemsMatProp(Geom_Type) *ElemsMatProp(Elem_Type)
*#
 ELEMENT GROUP ID *ReinfGroupID /** *ElemsMatProp(0) **/ TYPE *ReinfGroupID MATERIAL *ElemsMat(Int) GEOMETRY  *ElemsMat(Int) /** *ReinfGroupID **/
*#
*#EndIf
*#
*If(oMaxReinfGroups<ReinfGroupID)
*Set Var oMaxReinfGroups=ReinfGroupID
*EndIf
*If(oMinReinfGroups>ReinfGroupID)
*Set Var oMinReinfGroups=ReinfGroupID
*EndIf
*tcl(TK_SaveMaterialNumberVSGroupID *ElemsMatProp(0) *ReinfGroupID)
*tcl(TK_SaveMinMaxGroupIDVSMaterial *ElemsMatProp(0) *ReinfGroupID)
*#
*Set Var lineNum=Cond(Entity_number,Int)
 MACRO_ELEMENT *Cond(Entity_number,Int) GENERATE TYPE "CCDiscreteReinforcementME" THROUGH NODES *tcl(Nodes_of_Line *lineNum *ElemsMatProp(Quadratic_Elements))
*# tcl(NodesWithMaterial_And_EntityNum *ElemsMatProp(0) *lineNum )
        NAME "*ElemsMatProp(Name)*Cond(Entity_number,Int) >> #*nCables" MINIMUM *ElemsMatProp(Minimum) GROUP *ReinfGroupID /** EMBEDDED IN SOLIDS FROM *oMinIndexElemGroups TO *oMaxIndexElemGroups **/ *\
*If(ElemsMatProp(Embed_Short_Bars,Int)==1)
    TINY *\
*EndIf
*If(ReinfExecution==1)
 
 PROCESS_FLAG USE_REFERENCE_COORDS COPY_DEFORMATION_ONCE 
 Execute ;
*Else
 ;
*EndIf
*tcl(ReinfCheckMonitor *ElemsNum *ReinfGroupID)
*#
*Set Var nCables=Operation(nCables+1)
*#
*# End Materials
*If(assignmat==0)
// not assigned material at Line num:*lineNum
*ElemsNum *Cond(Entity_number,Int) *ElemsMat
*tcl(TK_Signal *ElemsNum)
*#MessageBox error: Some Reinforcements have not assignate material - please check it!
*tcl(TK_CTRLclear)*\
*tcl(TK_CTRLc "Error: Some Reinforcements have not assignate material - please check it! Element:" *ElemsNum)*\
*tcl(TK_TK_WarnWinTextTK_CTRLv)*\
*EndIf
*EndIf
*#
*Set Var lastReinfGroupID=ReinfGroupID
*EndIf
*EndIf
*End elems
// *\
*#if(VypsatUpozorneniTrussCablesOnlyFirstInterval==0)
*#set var VypsatUpozorneniTrussCablesOnlyFirstInterval=1
*#EndIf
*#
*#
*#if(VypsatUpozorneniTrussCablesOnlyFirstInterval==1)
*#WarningBox Info: You can only define Truss or Cables in the first Interval
*#set var VypsatUpozorneniTrussCablesOnlyFirstInterval=2
*#EndIf
*EndIf
*EndIf
*#
*#tcl(ZJ_WriteTime Konec)*\