NaikD
Mechanical
- Nov 23, 2002
- 48
Hi All,
I am new to ansys apdl and am not familiar with the coding. I know I am not doing this right.
Can someone help me with this code. I am trying to write x, y and z displacements to arrays dx, dy and dz
I appreciate your help!
Thank you,
Dipak
/post1
*cfopen,D:\documents\crank3.txt !Open output text file in a directory
*vwrite
CRANK,dx,dy,dz,ncount
! Selects a subset of components and assemblies (a new set, whose name is crank)
!set,3,1
cmsel,s,crank
nsle,s ! Select a set
*GET,nmax,NODE,0,num,max ! get highest node number in selected body
*GET,nmin,NODE,0,num,min ! get lowest node number in selected body
ncount=nmax-nmin+1
*DIM,dx,ARRAY,nmax
*DIM,dy,ARRAY,nmax
*DIM,dz,ARRAY,nmax
!Loop for all nodes (nmin to nmax with increment of 1000) in selected set
*do,i,nmin,nmax,1000
set,3,1
dx(i)=ux(i)
dy(i)=uy(i)
dz(i)=uz(i)
*vwrite
CRANK1,dx,dy,dz,ncount
*vwrite,dx(i),dy(i),dz(i),ncount
%15.5e,%15.5e,%15.5e,%8.0f
!*enddo
I am new to ansys apdl and am not familiar with the coding. I know I am not doing this right.
Can someone help me with this code. I am trying to write x, y and z displacements to arrays dx, dy and dz
I appreciate your help!
Thank you,
Dipak
/post1
*cfopen,D:\documents\crank3.txt !Open output text file in a directory
*vwrite
CRANK,dx,dy,dz,ncount
! Selects a subset of components and assemblies (a new set, whose name is crank)
!set,3,1
cmsel,s,crank
nsle,s ! Select a set
*GET,nmax,NODE,0,num,max ! get highest node number in selected body
*GET,nmin,NODE,0,num,min ! get lowest node number in selected body
ncount=nmax-nmin+1
*DIM,dx,ARRAY,nmax
*DIM,dy,ARRAY,nmax
*DIM,dz,ARRAY,nmax
!Loop for all nodes (nmin to nmax with increment of 1000) in selected set
*do,i,nmin,nmax,1000
set,3,1
dx(i)=ux(i)
dy(i)=uy(i)
dz(i)=uz(i)
*vwrite
CRANK1,dx,dy,dz,ncount
*vwrite,dx(i),dy(i),dz(i),ncount
%15.5e,%15.5e,%15.5e,%8.0f
!*enddo