TAGGED: ansys-mechanical, ansys-student, apdl, mechanical-apdl, structural
-
-
September 17, 2021 at 10:22 am
nitkum221
Subscriber*DIM,ELDENS,TABLE,100,1,1, , ,     ! Table  of Element  Densities  in  [g/cm3]
*VFILL,ELDENS(1,0),RAMP,1,1
*SET,ELDENS(1,1),1E-6
*DO,i,2,100
*SET,ELDENS(i,1),i/100*2         ! Density  range:   [1E-6;2]
*ENDDO
*SET,ELDENS(0,0),0
*SET,ELDENS(0,1),1
*DO,i,1,100
*SET,E_x,c_x*ELDENS(i)**gamma_E
*SET,E_y,c_y*ELDENS(i)**gamma_E
MP,EX,i,E_x
MP,EY,i,E_y
MP,EZ,i,E_y
MP,GXY,i,E_x/4
MP,GXZ,i,E_x/4
MP,GYZ,i,E_x/4
MP,PRXY,i,nu_xy
MP,PRYZ,i,nu_xy
MP,PRXZ,i,nu_xy
*enddo
*get,ELNUM,ELEM, ,count
*get,NNUM,NODE, ,count
*CFOPEN,ELNUM,txt
*VWRITE,ELNUM
%8I
*CFCLOS
September 17, 2021 at 10:51 amErKo
Ansys EmployeeMake sure you are under prep7 and not begin. So below is an example that prints this text file (just a single number with the number of elements in the model which is 2 in this case).
make sure that there are no blank lines between the lines/apdlcommands in the file (so when you copy paste the below into a text editor remove all blank lines):
so it should look like this:

Also run the .dat file and do not copy paste that - so run say the mwrite.dat file shown above.
Thank you
Erik
September 19, 2021 at 11:06 amnitkum221
SubscriberThank you sir for your help.
sir can you help me to remove the error in my code. Actually, I am studying a code and trying to run that code but the code is not working. This is an integrated code on Matlab and Ansys.
Viewing 2 reply threads- The topic ‘%8I is not a recognized BEGIN command, abbreviation, or macro. this command will be ignored.’ is closed to new replies.
Innovation SpaceTrending discussionsTop Contributors-
4633
-
1540
-
1386
-
1225
-
1021
Top Rated Tags© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-