*#include ..\include.src.bas\Ver.bas
*If(ndime==2)
*MessageBox error: For IXT export in 2D use IXT2D.
*End If
<Nodes>
*loop nodes
*format "%8i %10.5f %10.5f %10.5f"
*NodesNum *NodesCoord
*End nodes

*# // count of Hexahedra             *nelem(Hexahedra)
*Set  elems(Hexahedra)    
<Elements>
*If(IsQuadratic(int)==0 && nelem>0)
ELEMENT_TYPE CCIsoBrick<xxxxxxxx>
*loop elems
	*ElemsNum *ElemsConec(5) *ElemsConec(6) *ElemsConec(7) *ElemsConec(8) *ElemsConec(1) *ElemsConec(2) *ElemsConec(3) *ElemsConec(4) 
*End elems
*End If

*If(IsQuadratic(int)==1 && nelem>0)
ELEMENT_TYPE CCIsoBrick<xxxxxxxxxxxxxxxxxxxx>
*loop elems
	*ElemsNum *ElemsConec(5) *ElemsConec(6) *ElemsConec(7) *ElemsConec(8) *ElemsConec(1) *ElemsConec(2) *ElemsConec(3) *ElemsConec(4) *ElemsConec(17) *ElemsConec(18) *ElemsConec(19) *ElemsConec(20) *ElemsConec(9) *ElemsConec(10) *ElemsConec(11) *ElemsConec(12) *ElemsConec(13) *ElemsConec(14) *ElemsConec(15) *ElemsConec(16)	
*End elems
*End If

*# // count of Tetrahedra            *nelem(Tetrahedra)
*Set elems(Tetrahedra) 
*If(IsQuadratic(int)==0 && nelem>0)
ELEMENT_TYPE CCIsoTetra<xxxx>
*loop elems
	*ElemsNum *ElemsConec
*End elems
*End If

*If(IsQuadratic(int)==1 && nelem>0)
ELEMENT_TYPE CCIsoTetra<xxxxxxxxxx>
*loop elems
	*ElemsNum *ElemsConec
*End elems
*End If

*# // count of Quadrilateral         *nelem(Quadrilateral)
*Set elems(Quadrilateral)
*If(IsQuadratic(int)==0 && nelem>0)
ELEMENT_TYPE IsoQuad<xxxx>
*loop elems
	*ElemsNum *ElemsConec
*End elems
*End If

*If(IsQuadratic(int)==1 && nelem>0)
ELEMENT_TYPE IsoQuad<xxxxxxxx>
*loop elems
	*ElemsNum *ElemsConec
*End elems
*End If
*# // count of Triangle              *nelem(Triangle)
*Set elems(Triangle)  
*If(IsQuadratic(int)==0 && nelem>0)
ELEMENT_TYPE IsoTriangle<xxx>
*loop elems
	*ElemsNum *ElemsConec
*End elems
*End If

*If(IsQuadratic(int)==1 && nelem>0)
ELEMENT_TYPE IsoTriangle<xxxxxx>
*loop elems
	*ElemsNum *ElemsConec
*End elems
*End If
*# // count of Prism              *nelem(Prism)
*Set elems(Prism)
*If(IsQuadratic(int)==0 && nelem>0)
ELEMENT_TYPE IsoWedge<xxxxxx>
*loop elems
	*ElemsNum *ElemsConec
*End elems
*End If

*If(IsQuadratic(int)==1 && nelem>0)
ELEMENT_TYPE IsoWedge<xxxxxxxxxxxxxxx>
*loop elems
	*ElemsNum *ElemsConec
*End elems
*End If
*# 1=Linear, 2=Triangle, 3=Quadrilateral, 4=Tetrahedra, 5=Hexahedra, 6=Prism
*# // count of Linear                *nelem(Linear)
*Set elems(Linear)
*If(IsQuadratic(int)==0 && nelem>0)
ELEMENT_TYPE CCIsoTruss<xx>
*loop elems
	*ElemsNum *ElemsConec
*End elems
*End If

*If(IsQuadratic(int)==1 && nelem>0)
ELEMENT_TYPE CCIsoTruss<xxx>
*loop elems
	*ElemsNum *ElemsConec
*End elems
*End If

*Set Var previousElemsNum=-1
*Set Var previousElemsType=-1
*Set Var previousElemsMat=-1
*Set Var MacroelementID=1

*Set elems(All) 
<Macroelements>
*loop elems
*If(ElemsMat == previousElemsMat && ElemsType == previousElemsType)
*# If(ElemsNum != previousElemsNum+1)
*MacroelementID *ElemsNum
*# EndIf
*Else
*Set Var MacroelementID=Operation(MacroelementID+1)
*MacroelementID *ElemsNum
*End If
*Set Var previousElemsNum=ElemsNum
*Set Var previousElemsMat=ElemsMat
*Set Var previousElemsType=ElemsType
*End elems
