General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

Export modeshapes with apdl command to csv or txt-file

    • BassaSelim3
      Subscriber

      Hello everyone,

      I am trying to export the modeshape of an modal analysis automatically with an apdl command in the mechanical enviroment and merge them together for each mode in every direction (x,y,z). So far I was able to export the participation factor, the eigenfrequencies and the starting coordinates of each node. Now I want to export the modeshapes (which are in my perspective the eigenvectors of each node). So the file should look like this:

      directional "deformation" in x for mode 1 directional "deformation" in y for mode 1 ....... x for mode i

      Node1

      Node2

      Node3

      I couldnt find an apdl command to extract this information so far. I dont want to plot all the deformation and export them manually and I dont want to use an ACT like "Multi Object Export"

    • Aniket
      Forum Moderator
      Please check *VGET, *VWRITE commands. Google "Writing Text files with *VWRITE"
      -Aniket
      How to access Ansys help links
      Guidelines for Posting on Ansys Learning Forum


    • BassaSelim3
      Subscriber
      Hi Aniket thanks you for the input. I know only a little bit about *VGET and *VWRITE. What I am looking for ist the command accessing the mode shape deformation data. So I want the data as shown in the screenshot. But instead of doing this manually I want to create an apdl command block, so that I can automate that task for many modes
    • Aniket
      Forum Moderator
      Ansys staff can not download any files on the forum, so if you want to reach a larger audience to get answers from, please insert inline images describing your problem.
      Also, Ansys employees won't be able to write code for you, but hopefully, other members can chime in here.
      -Aniket
      How to access Ansys help links
      Guidelines for Posting on Ansys Learning Forum
    • BassaSelim3
      Subscriber
      Okay, I hope the image below will help. As mentioned above I don't know the apdl command getting the "deformation" for every node in every mode and direction. As I know this command I think I can write the macro by myself.

    • Erik Kostson
      Ansys Employee


      As my colleague said, look at the *GET, *VGET commands - also we can not provide any help with the scripting or provide scripts, but there are many posts using these command on this forum and on the internet, which might help. Also the help manual (apdl) might have some examples and it has lots of information on what these commands can get (for instance displacements).

      below is an example that might be useful, but do search as mentioned above, and perhaps also some other members of this forum can provide some comments/feedback.

      All the best of luck

      Erik
    • BassaSelim3
      Subscriber
      and everybody else struggling with this problem With your example I was able to write the code below (It was the set command I was looking for). Thank You
      I could solve the issue with the folling line of code:

      *GET,knotenanzahl,NODE,0,COUNT
      *GET,modenanzahl,ACTIVE,0,SOLU,NCMSS
      *DO,k,1,modenanzahl,1
      *DIM,Matrix,knotenanzahl,4
      set,1,k
      *VFill,Matrix(1,1),RAMP,1,1
      *VGET,Matrix(1,2),node,1,u,x
      *VGET,Matrix(1,3),node,1,u,y
      *VGET,Matrix(1,4),node,1,u,z
      *CFOPEN,Eigenvektoren,txt,'C:\Users\hubejan\Desktop',APPEND
      *VWRITE,Matrix(1,1),Matrix(1,2),Matrix(1,3),Matrix(1,4)
      (F0.0,';',F0.4,';',F0.4,';',F0.4)
      *cfclos
      *ENDDO

      With this code I almost create the values I wanted. unfortunately I also get the nodes related to remote displacements, remote points, Connections, etc. (everything that is related to a coordinate system). Is there an easy solution to delete these nodes that are not included in the mesh?

    • BassaSelim3
      Subscriber
      And is there a command to clear generated data? (The command /CLEAR doesn't work)
    • Erik Kostson
      Ansys Employee
      Use

      CMSEL,S,PART,NODE
      then, the *get and *vget command should get only those nodes that you put in the named selection called PART and which we select with the CMSEL command (so add that on the top of your script). Also create a named selection of the part you want to assess, that is called PART.

      As for deleting, see if the *DEL command (deletes parameters)
      All the best

      Erik
    • BassaSelim3
      Subscriber
      Hey Erik thank you very much. With CMSEL,S,PART,NODE I coluld exclude the unnecessary nodes. I had to create a named selection of all nodes and named this selection PART (I used node select and box volume select) . A named Selection of all bodies didn't work.
      So the next step would be to create the named selection of all nodes automatically. is this possible?
    • BassaSelim3
      Subscriber
      To clear the generated Data I used the command
      *DEL,ALL,_PRM
      at the top of my command block and so far it works
Viewing 10 reply threads
  • The topic ‘Export modeshapes with apdl command to csv or txt-file’ is closed to new replies.