General Mechanical

General Mechanical

Topics relate to Mechanical Enterprise, Motion, Additive Print and more

Export of nodal displacements from Workbench to txt file

    • teaxdriv
      Subscriber

      Hello,


      I would like to ask you how to export nodal displacements from Worbench?


      Best regards

      Michal

    • peteroznewman
      Subscriber
      Insert a Directional Deformation result under the Solution. After the analysis is solved, right click on the result and use the Export Text File feature. Note that is only for one direction. Insert two more results for the other two directions.
    • teaxdriv
      Subscriber
      Hello peteroznewman thank you very much for your reply! I know this, but I search for automated way of export using APDL or Python script. The results should look like: Node ID X coord Y coord Z coord UX UY UZ USUM.
      Best regards
      Michal
    • Erik Kostson
      Ansys Employee
      Hi Michal
      Yes it is possible to export using apdl or act or python results (dpf), but it is something you would need to script your self.

      Search the forum and the internet and you should find plenty of information
      (The function to search for in the ACT/API guide/help manual for in order to get nodal displacements is GetNodeValues)
      Also dpf results and dpf scripting can do this.
      All the best

      Erik
    • teaxdriv
      Subscriber
      Hello ekostson thank you for your advice! I have searched the internet many time, and on top of that, I am using currently the script from the topic which you sent, but I have a problem with implementation of nodal coordinate x y z. I am still getting incorrect results, so I ask for help here.
      BR
      Michal

    • Erik Kostson
      Ansys Employee
      Hi Michal

      If you can explain which approach you are using, and also attach the actual script used (inline as text in your next post) ? Finally what is the issue with it, then perhaps someone can be of help and offer some feedback.
      Erik

    • teaxdriv
      Subscriber
      Hello Erik for example if we use APDL script I am not sure how to modify it to export along with UX,UY,UZ,USUM also nodal coordinate and Node ID?
      /post1
      set,last cmsel,s, !select Named Selection scoped nodes
      *get,nmx,node,,num,max
      *dim,ndat,array,nmx,4
      *vget,ndat(1,1),node,1,nsel
      *vmask,ndat(1,1)
      *vfill,ndat(1,1),ramp,1,1 ! store node number
      *vmask,ndat(1,1)
      *vget,ndat(1,2),node,1,u,x
      *vmask,ndat(1,1)
      *vget,ndat(1,3),node,1,u,y
      *vmask,ndat(1,1)
      *vget,ndat(1,4),node,1,u,z
      *vmask,ndat(1,1)
      *cfopen,vwr,csv
      *vwrite,ndat(1,1),ndat(1,2),ndat(1,3),ndat(1,4) (f8.0,3(',',g16.9))
      *cfclose
    • Erik Kostson
      Ansys Employee
      Hi

      Look on the *vget command and the node section (LOC ) which will show how to get the location.
      (e.g., *vget,ndat(1,5),node,1,loc,x ---- gets the x loc and so on and so forth)

      As for the node numbers they are given by ndat(1,1) so the first column in the text file.

      for guidance on apdl and look in the help manual (*vget, and all other commands).
      All the best
    • teaxdriv
      Subscriber
      Hello ekostson Thank you very much. This works, but also I would like to ask you for setting of format like in the attached text file with the names of columns Node ID X CoordY CoordZ CoordXYZMagnitude. The columns have fixed width of 26.
      Can you help me with it?

      Best regards
      Michal




Viewing 8 reply threads
  • You must be logged in to reply to this topic.