APDL commands to save results for each of applied load step


I'm new in APDL and I'm looking for a script which I can apply to automatically export Frequency Response results to a .xls file. I have two frequency responses - one depends on X-axis and the other depends on Y-axis of the Global Coordinate System. I have 180 load steps and I need to export those file for every step - doing it manually would be a nightmare.

Frequency response is applied to these two bodies (bolts are not included):

Please help me in writing the script. I've found a script which is above, but I completely don't know how to change it.

/post26                !Use Time-History postprocessor

file,file,rth             !Read file.rth

*do,i,1,2               !Loop over three coordinate system

csys,cs%i%               !Change active coordinate system to cs1, cs2, cs3 and so on

mynode=node(0,0,0)           !Get node number for node closest to origin

nsol,2,mynode,temp           !Get teperature results for node

store,merge              !Store the results in the database

*get,size,vari,,nsets         !Get number of timesteps

*dim,temps_cs%i%,array,size      !Create array parameter 

vget,temps_cs%i%(1),2         !Store time-history data of variable 2 into temps_cs1 *enddo    !End loop

*dim,timearr,array,size        !Define array for time values

vget,timearr(1),1           !Store time values 

! Search the location of the first folder name starting with 'dp'

dpFolder = '\dp'

dpLoc = STRPOS(_wb_SolverFiles_dir(1),dpFolder)

! Get the 6 characters after \dp

CutPath = STRSUB(_wb_SolverFiles_dir(1),dpLoc+3,6)

! Get the string position of the next directory separator

DirSepLoc = STRPOS(CutPath,'\')

! Remove the characters starting from the directory separator

dpNb = STRSUB(CutPath,1,DirSepLoc-1) 

*cfopen,'%_wb_userfiles_dir(1)%\Temperature_curves_dp%dpNb%',csv         !Write results to Temperature_curves.csv



*vwrite,timearr(1),temps_cs1(1),temps_cs2(1),temps_cs3(1)     ! Write array in given format to file (f12.3,';',f12.3,';',f12.3,';',f12.3) 



  • HuiLiuHuiLiu Forum Coordinator

    Could you please clarify your question? You said you want to output frequency response, doesn't right click on solution - insert - frequency response work for this purpose? Is the script you posted here from some other model, since it is pointing to a .rth file?

  • Yes, right click and insert frequency response works, but I need to also to Insert Commands to results, to export those results to excel by using script, because I have a lot of load steps.

    And yes, the script is from other model which I,ve found on the internet.

  • HuiLiuHuiLiu Forum Coordinator

    If you already have the frequency response result under your solution, right click on that frequency response result and export should allow you to export the txt file. Have you tried that and did that work? No matter how many load steps / frequency intervals you have, the frequency response should print the history data that includes all.

  • mkuzwamkuzwa Member
    edited September 23

    I have all design points updated: (now there are only 5 to give an example)

    And DP 0 is my current design point. I open the results:

    And here are results only for DP 0.

  • mkuzwamkuzwa Member
    edited September 24

    OMG sorry, I meant Design Points, not load steps...

Sign In or Register to comment.