*Intformat "%10i "
*#
*Set Var groupID=-1
*Set Var previousGroupID=-2
*Set Var previousGroupID2=-2
*Set Var previousGroupID3=-2
*Set Var previousGroupID4=-2
*Set Var previousGroupID5=-2
*Set Var nshells=0
*Set Var nbeam=0
*#
*Set Cond Reinforcement_Inactivity_for_Line  *elems  *CanRepeat
*If(CondNumEntities(Int)>0)
// selection has *CondNumEntities entities
//----------------------------------------------------------------------------
//                              reinforcement INACTIVITY
//----------------------------------------------------------------------------
*loop elems *OnlyInCond
*Set Var EActivity=Operation(EActivity+1)
*#
*include ..\include.src.bas\CurrentElementgroupID.bas
*#
*Set Var groupID=Operation(ElemsMat*IncrMaterialID+CurrentType)
*If(strcmp(ElemsMatProp(Material_Prototype),"CCReinforcement")==0 || strcmp(ElemsMatProp(Material_Prototype),"CCDiscreteReinforcementME")==0 || strcmp(ElemsMatProp(Material_Prototype),"CCCyclingReinforcement")==0 || strcmp(ElemsMatProp(Material_Prototype),"CCSmearedReinf")==0 || strcmp(ElemsMatProp(Material_Prototype),"CC1DElastIsotropic")==0 || strcmp(ElemsMatProp(Material_Prototype),"CCStellDRC")==0 || strcmp(ElemsMatProp(Material_Prototype),"CCReinforcementWithTempDepProperties")==0 )
*#// reinforcement
*Set Var groupID = Operation(InitCablesID+Cond(Entity_number,Int))
*#Set Var myEntity_number = Cond(Entity_number,Int)
*#MACRO_ELEMENT *myEntity DELETE ;
*EndIf
*#
*#If(strcmp(Cond(1),"INACTIVE")==0)
*If(groupID!=previousGroupID && groupID!=previousGroupID2 && groupID!=previousGroupID3 && groupID!=previousGroupID4 && groupID!=previousGroupID5)
*#DELETE ENFORCED ELEMENT GROUP *groupID ;
*If(Cond(Different_material,Int)==1)
// change to material *Cond(Assign_material)
*Set Var oMujMaz=tcl(TK_FindMaterialNumber *Cond(Assign_material) "")
*#oMujMaz = *oMujMaz
*#
*#  // zapis definice materialu
*Set Var oMatUse=0
*loop materials *NotUsed *all
*#loop materials *NotUsed 
*# MatProp(0) *Cond(Assign_material)
*If(strcmp(MatProp(0),Cond(Assign_material))==0)
*Set Var oMatUse=1
*Set Var matvar=oMujMaz
;
*include ..\include.src.bas\MaterialFunctionAndParameters.bas
*include ..\include.src.bas\MaterialDefinition.bas
*break
*EndIf
*End materials
*#
*If(oMatUse(Int)==0)
*loop materials *all
*#loop materials *NotUsed 
*# MatProp(0) *Cond(Assign_material)
*If(strcmp(MatProp(0),Cond(Assign_material))==0)
*Set Var oMatUse=1
*Set Var matvar=oMujMaz
;
*include ..\include.src.bas\MaterialFunctionAndParameters.bas
*include ..\include.src.bas\MaterialDefinition.bas
*break
*EndIf
*End materials
*endif *# // konec zapis definice materialu
*#
*#  // zapis definice geometrie
*# GEOMETRY ID *ElemsMat // NAME "Interactive Geometry #*Operation(nmats+IntervalIndex)" 
*Set Var oMatUse=0
*loop materials *NotUsed *all
*#loop materials *NotUsed
*# ////// zjisteni kvadratic
*Set Var MaterialQuadratic=ElemsMatProp(Non-Quadratic_Element,Int)
*Set Var JeQuadratic = IsQuadratic(Int)
*If(MaterialQuadratic==1)
*Set Var JeQuadratic = 0
*EndIf
*# ////// zjisteni kvadratic end
*If(strcmp(MatProp(0),Cond(Assign_material))==0)
*Set Var oMatUse=1
*Set Var matvar=oMujMaz
*include ..\include.src.bas\MaterialGeometry.bas
*break
*EndIf
*End materials
*#  // konec zapis definice geometrie
*#
*#
*#
ELEMENT GROUP ID *groupID INACTIVE ;
*If(Cond(Different_material,Int)==1 && Cond(Reset_Material_Points,Int)==1)
DELETE MATERIAL_POINTS GROUP *groupID  
*EndIf
ELEMENT GROUP ID *groupID MATERIAL *oMujMaz ;
ELEMENT GROUP ID *groupID GEOMETRY *oMujMaz ;
*EndIf
*#
ELEMENT GROUP ID *groupID *Cond(1) ;

*If(Cond(Different_material,Int)==1)
*#  // zapis definice geometrie
*# GEOMETRY ID *ElemsMat // NAME "Interactive Geometry #*Operation(nmats+IntervalIndex)" 
*Set Var oMatUse=0
*loop materials *NotUsed *all
*#loop materials *NotUsed
*# ////// zjisteni kvadratic
*Set Var MaterialQuadratic=ElemsMatProp(Non-Quadratic_Element,Int)
*Set Var JeQuadratic = IsQuadratic(Int)
*If(MaterialQuadratic==1)
*Set Var JeQuadratic = 0
*EndIf
*# ////// zjisteni kvadratic end
*If(strcmp(MatProp(0),Cond(Assign_material))==0)
*Set Var oMatUse=1
*Set Var matvar=oMujMaz
*include ..\include.src.bas\MaterialGeometry.bas
*break
*EndIf
*End materials
*#  // konec zapis definice geometrie
*EndIf

*#DELETE ENFORCED ELEMENT TYPE *groupID
*#Set Var matvar=ElemsMat
*#include ..\include.src.bas\DeleteMaterialElementActivity.bas
*#
*Set Var previousGroupID5=previousGroupID4
*Set Var previousGroupID4=previousGroupID3
*Set Var previousGroupID3=previousGroupID2
*Set Var previousGroupID2=previousGroupID
*Set Var previousGroupID=groupID
*#
*EndIf
*#EndIf
*End elems

*#
//----------------------------------------------------------------------------
//                             reinforcement INACTIVITY END
//----------------------------------------------------------------------------
*EndIf
