با استفاده از ماکرو می تونید هر چیزی رو به صورت تابعی در بیارید مثلا من در یک پروژه مدول الاستیسیته رو به صورت تابع نوشتم
/PREP7
/TITLE,"Elastic infinit FGM" beam on "Elastic foundation"
ET,1,BEAM54 ! Use BEAM54 as element type
*ask,L, the Length of Beam !L=the length of beam
*ask,num, the Number of Element !num=the number of element
*ask,k, the Elastic Foundation stiffness "EFS" of Element Beam !k=elastic fondation ceoffect
*ask,I, the Moment of inertia abiut Z(mm3) !I=the moment of inertia
*ask,A, the Cross-sectional Area(m2) !A=the area
R,1,A,I*10**(-9),0.01
RMORE,1,0,0,0,0,0,0
RMORE,1,0,0,k,0,0,0,
N,1,0,0
nl=num+1
N,nl,L
FILL,1,nl
/AUTO,1
/GTYPE,1,elem,1
/ZOOM,1,SCRN,
*ask,E0, the Initial Modulus of Beam E0

Gpa) !E0(Gpa)=the initional of modulus
*ask,B, the power of Function Modulus that we define !B=power of modulus
*dim,E,,num
*do,i,1,num
mp,ex,i,E0*(10**9)*(1+(((i-1)/num)))**B
mp,prxy,i,0
*enddo
*do,j,1,num
E,j,j+1
*enddo
MPCHG,2,ALL
*do,jj,1,num
MPCHG,jj,jj
*enddo
nummrg,node,
nummrg,elem,
/AUTO,1
*ask,pp,1 or 0 ;if you want to define force enter 1 otherwise Enter 0 !p=if you want force enter 1 if dont want enter 0
*IF,pp,EQ,1,THEN
*ask,Lx,the location Force that you want to define on Beam (Lx) !Lx=the force of node
*ask,Fnode, the value Force that you want to define on Beam (Fy) !Fnode=the force of node
F,Lx*(num/L)+1,FY,Fnode
*ELSE
*ENDIF
/AUTO,1
*ask,M,1 or 0;if you want to define Moment Enter 1 otherwise Enter 0 !M=if you want force enter 1 if dont want enter 0
*IF,M,EQ,1,THEN
*ask,Mx, the location Moment that you want to define on Beam (Mx) !Mx=the force of node
*ask,Mnode, the value Moment that you want to define on Beam !Mnode=the force of node
F,Mx*(num/L),MZ,Mnode
*ELSE
*ENDIF
/AUTO,1
*ask,rr,1 or 0;if you want to define pressure enter 1 otherwise Enter 0 !rr=if you want force enter 1 if dont want enter 0!rr=if you want force enter 1 if dont want enter 0
*IF,rr,EQ,1,THEN
*ask,ell,Length of Beam that you want to define pressuer load on it !ell=length of beam that you want the pressuer load on
*ask,Lp,Location of start pressuer on beam !Lp=length of beam that you want the pressuer load on
*ask,pressure, the value of pressure that you want to define pressuer on Beam!pressure=length of beam that you want the pressuer load on
*DO,ii,Lp*(num/L),Lp*(num/L)+(num*ell)/L
SFBEAM,ii,1,PRESS,pressure
*ENDDO
*ELSE
*ENDIF
/psf,PRES,INRM,1,1,ON
D,1,UY,ROTZ,
D,nl,UY,ROTZ,
finish
/sol
solve
finish
/psf,PRES,INRM,1,1,ON
/POST1
/psf,PRES,INRM,1,1,ON
PLDISP,2 ! Deformed shape
/psf,PRES,INRM,1,1,ON
------------------------------------------------------------------------------
این ماکرو رو در یک فایل notpad کپی کنید و بعد با پسوند db. دخیره و در ANSYS اجرا کنید تا پی ببرید
--------------------------------------------
اگر دوست دارید کل صورت مسئله(ماده المان بارگذاری و ...) رو به ایمیلم بفرستید تا ماکروی اون را براتون بنویسم.
hamidmech82@yahoo.com