General Mechanical

General Mechanical

Writing a command snippet for saving a probe table in ANSYS Workbench.

    • Punnag Chatterjee
      Subscriber

       Hello all, I am finding it difficult to write a command snippet to export a displacement probe tabular data from ANSYS Workbench 19.1>Transient Mechanical module. The following code does not seem to work.



      Position of command snippet


      *cfopen,simple,txt


      *VWRITE,Time(1),Dy(1)


      (F10.0,F10.0)


      *cfclose


       


      I am clearly making some mistakes in the command snippet code.


       


      I have already created the file 'simple.txt' and placed it in the working directory:


      'C:ANSYS Analysis filesFull_transient_and_MSUP_Peter_files'


       


      Nothing gets written and the file is empty, I cannot figure out the reason.

    • jpasquerell
      Ansys Employee

      Post processing command objects have no default data so you need to store the data via the set command.  I would first recommend trying a right mouse pick on the Dy and try exporting it that way.  If not then the command object would be based on this (and it would be at the node nearest the x y z location).  I did not test it and I believe it will not like time as an array name so you may need to use a different array name:


       


      xnod=1.2    ! change to be the desired global x location


      ynod=3.4   ! change to be the desired global y location


      znod=5.6   ! change to be the desired global z location


      set,first


      nnod=node(xnod,ynod,znod)


      *get,numres,active, ,set,nset              ! count of results sets


      *dim,time,array,numres


      *dim,dy,array,numres  


      *get,time(1),active, ,set,time


      *get,dy(1),node,nnod,u,y


      *do,jj,2,numres


      set,next


      *get,time(jj),active, ,set,time


      *get,dy(jj),node,nnod,u,y


      *enddo


      !


      *cfopen,simple,txt


      *VWRITE,Time(1),Dy(1)


      (F10.0,F10.0)


      *cfclose


       

    • Rahul Kumbhar
      Ansys Employee

      Hi,


      Also there is one workaround in Mechanical, you can export or copy the cells by RMB click in upper-left corner cell of the tabular data. You can paste this data in txt or excel file.


    • Punnag Chatterjee
      Subscriber

      Hi,


      Thanks for the reply. I am already aware this method. I wanted a code based solution so as to automate the process since I would be doing the operation over multiple iteration cycles. Thanks.

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