using *get for multiple substeps

  • 75 Views
  • Last Post 23 November 2018
  • Topic Is Solved
Vanderbezi posted this 15 November 2018

Greetings,

i am using the following APDL commands to measure the rotation of two external points:

*get,my_rotx1,node,my_pilot1,rot,x

*get,my_rotx2,node,my_pilot2,rot,x

pi=acos(-1)

my_rotx1=my_rotx1*180/pi

my_rotx2=my_rotx2*180/pi

I am using 10 loadsteps in a static analysis and getting only the results for the last .

How can i get these results for the different loadsteps?

regards,

Vanderbezi

Order By: Standard | Newest | Votes
jpasquerell posted this 15 November 2018

In post1 the set command tells the program what results to read from the rst file.  

 

set,first

*do,jj,1,10

! put your block of commands here

*if,jj,lt,10,then

set,next

*endif

*enddo

 

 

  • Liked by
  • Vanderbezi
Vanderbezi posted this 16 November 2018

Hello jpasquerell,

i tried that but i still cant see the values for the different loadsteps.

here is a screenshot of the results.

regards,

Vanderbezi

rgpatchi posted this 23 November 2018

Hello Vanderbezi, 

Could you paste your APDL commands used instead of snapshot? The picture is not so clear.

But from my understanding, you simply pasted your command set (in your first post) at the location Jim suggested in his script.

If yes, the values for parameters, my_rotx1 (for example) will be replaced during each loop by values at the next result set and the values you finally get are those corresponding to last result set.

Do you need all the 40 parameters in the details of the command snippet?

If not, you can simply modify the script as shown below, by adding %i% to the name (and removing my_), and after the loop, just getting those values needed into the details box of the command snippet.

 

set,first

 

*do,jj,1,10

 

! put your block of commands here

 

*get,rotx1,node,my_pilot1,rot,x

 

*get,rotx2,node,my_pilot2,rot,x

 

pi=acos(-1)

 

rotx1_set_%i%=my_rotx1*180/pi

 

rotx2_set_%i%=my_rotx2*180/pi

 

*if,jj,lt,10,then

 

set,next

 

*endif

 

*enddo

 

!Extracting rotx1 at set 5

my_rotx1 = rotx1_set_5

Other option is to use an array instead of a scalar parameter in the loop and write out the array data to an external file using *CFOPEN and *VWRITE commands for example. 

Hope this helps. 

Best regards,

Rohith

  • Liked by
  • SandeepMedikonda
Close