*#FILE_EXTENSION .dxf
*realformat "%15.5f"
*intformat "%7i"
*# Interface GID-SAP2000 DXF 
*# To export mesh of triangles/quadrilateral/lines
*# Written by Kike III - December 2002. Last update December 2002
*Set var HANDLE=21
  0
SECTION
  2
ENTITIES
*Set var NNODO=2
*Set elems(Linear)
*Loop elems
  0
LINE
  5
*format "%i"
*HANDLE
*Set var HANDLE=operation(HANDLE(int)+1)
  8
SAP_FRAMES
*for(INODO=1;INODO<=NNODO;INODO=INODO+1)
*for(IGDL=1;IGDL<=3;IGDL=IGDL+1)
*format "%i%i"
 *IGDL*Operation(INODO-1)
*nodescoord(*INODO,*IGDL,real)
*end IGDL
*end INODO
*End elems
*Set var NNODO=4
*Set elems(Triangle)
*Loop elems
  0
3DFACE
  5
*format "%i"
*HANDLE
*Set var HANDLE=operation(HANDLE(int)+1)
  8
SAP_SHELLS
*for(INODO=1;INODO<=NNODO;INODO=INODO+1)
*for(IGDL=1;IGDL<=3;IGDL=IGDL+1)
*format "%i%i"
 *IGDL*Operation(INODO-1)
*if(INODO==NNODO)
*set var PREVINODO=Operation(INODO-1)
*nodescoord(*PREVINODO,*IGDL,real)
*else
*nodescoord(*INODO,*IGDL,real)
*endif
*end IGDL
*end INODO
*end elems
*Set var NNODO=4
*Set elems(Quadrilateral)
*Loop elems
  0
3DFACE
  5
*format "%i"
*HANDLE
*Set var HANDLE=operation(HANDLE(int)+1)
  8
SAP_SHELLS
*for(INODO=1;INODO<=NNODO;INODO=INODO+1)
*for(IGDL=1;IGDL<=3;IGDL=IGDL+1)
*format "%i%i"
 *IGDL*Operation(INODO-1)
*nodescoord(*INODO,*IGDL,real)
*end IGDL
*end INODO
*end elems
  0
ENDSEC
  0
EOF
