得到节点
NNode=0
I=1
X=0
Y=0
Z=0
*CFOPEN,'Node','txt',' '
*Get,NNode,Node,0,Count
*do,I,1,NNode
X=NX(I)
Y=NY(I)
Z=NZ(I)
*VWRITE,I,'X=',X,' Y=',Y,' Z=',Z
(F,A,F,A,F,A,F)
*ENDDO
*CFCLOS
框架单元
NFrame=0
NElem=0
I=0
EType=0
N1=0
N2=0
NRE=0
*CFOPEN,'Frame','txt',' '
*Get,NElem,Elem,0,Count
*DO,I,1,NELEM
*GET,ETYPE,ELEM,I,ATTR,TYPE
*IF,ETYPE,EQ,1,THEN
NFrame=NFrame+1
*GET,N1,ELEM,I,NODE,1 !得到第一节点号
*GET,N2,ELEM,I,NODE,2 !得到第二节点号
*GET,NRE,ELEM,I,ATTR,REAL !得到实参数号
*VWRITE,NFRAME,' J=',N1,' ',N2,' SEC=',NRE,' NSEG=2 ANG=0'
(F,A,F,A,F,A,F,A)
*ENDIF
*ENDDO
*CFCLOS
壳单元
NSHELL=0
NElem=0
I=0
EType=0
N1=0
N2=0
N3=0
N4=0
NRE=0
*CFOPEN,'SHELL','txt',' '
*Get,NElem,Elem,0,Count
*DO,I,1,NELEM
*GET,ETYPE,ELEM,I,ATTR,TYPE
*IF,ETYPE,EQ,2,THEN
NSHELL=NSHELL+1
*GET,N1,ELEM,I,NODE,1 !得到第1节点号
*GET,N2,ELEM,I,NODE,2 !得到第2节点号
*GET,N3,ELEM,I,NODE,3 !得到第3节点号
*GET,N4,ELEM,I,NODE,4 !得到第4节点号
*GET,NRE,ELEM,I,ATTR,REAL !得到实参数号
*VWRITE,NSHELL,' J=',N1,N2,N4,N3,' SEC=',NRE
(F,A,F,F,F,F,A,F)
*GET,ETYPE,ELEM,I,ATTR,TYPE
*IF,ETYPE,EQ,2,THEN
NSHELL=NSHELL+1
*GET,N1,ELEM,I,NODE,1 !得到第1节点号
*GET,N2,ELEM,I,NODE,2 !得到第2节点号
*GET,N3,ELEM,I,NODE,3 !得到第3节点号
*GET,N4,ELEM,I,NODE,4 !得到第4节点号
*GET,NRE,ELEM,I,ATTR,REAL !得到实参数号
*VWRITE,NSHELL,' J=',N1,N2,N4,N3,' SEC=',NRE
(F,A,F,F,F,F,A,F)
*ENDIF
*ENDDO
*CFCLOS
集中质量
NMASS
NElem=0
I=0
EType=0
N1=0
NRE=0
MX=0
MY=0
MZ=0
*CFOPEN,'MASS','txt',' '
*Get,NElem,Elem,0,Count
*DO,I,1,NELEM
*GET,ETYPE,ELEM,I,ATTR,TYPE
*IF,ETYPE,EQ,3,THEN
NMASS=NMASS+1
*GET,N1,ELEM,I,NODE,1 !得到第一节点号
*GET,NRE,ELEM,I,ATTR,REAL !得到实参数号
*GET,MX,RCON,NRE,CONST,1, !得到实参数第一个数值
*GET,MY,RCON,NRE,CONST,2, !得到实参数第一个数值
*GET,MZ,RCON,NRE,CONST,3, !得到实参数第一个数值
*VWRITE,'ADD=',N1,' U1=',MX,' U2=',MY,' U3=',MZ
(A,F,A,F,A,F,A,F)
*ENDIF
*ENDDO
*CFCLOS