Which scripting part or Pyansys modules can I use to obtain results in the .avz format?

Options
Naveen Kumar Begari
Naveen Kumar Begari Member Posts: 19
First Comment Name Dropper Photogenic
edited July 8 in Structures

As we have ansys viewer to read .avz files to get visualisation in 3D.
Is their anything in pyansys same as ansys viewer or do we have any other extensions...?

Answers

  • Abel Ramos
    Abel Ramos Member, Employee Posts: 40
    5 Likes First Answer First Comment First Anniversary
    Options

    Hello, depending on your needs you can use pyDPF (or dpf in mechanical) to plot your results natively in a 3D visualization.

    For example:
    https://post.docs.pyansys.com/

    Best Regards,

  • Naveen Kumar Begari
    Naveen Kumar Begari Member Posts: 19
    First Comment Name Dropper Photogenic
    Options

    Hi @Abel Ramos
    But in PyDPF, 3D interactively outputs are unable to extract. If you have an overview on this.? Please share here

    Regards
    Naveen.

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee Posts: 237
    First Answer First Comment 5 Likes First Anniversary
    Options
    ## AVZ export
    import wbjn
    import os
    userdirectory = wbjn.ExecuteCommand(ExtAPI,'returnValue(GetUserFilesDirectory())')
    results =ExtAPI.DataModel.GetObjectsByType(DataModelObjectCategory.Result)
    #loop over the results
    for result in results:
        result.Activate()
        mvm = ExtAPI.Graphics.ModelViewManager
        #avzFilename = r'D:\Temp\{}.avz'.format(result.Name)
        avzFilename = os.path.join(userdirectory,'{}.avz'.format(result.Name))
        mvm.Capture3DImage(avzFilename)
    
  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee Posts: 237
    First Answer First Comment 5 Likes First Anniversary
    Options
    import wbjn
    import os
    def ExportAVZ(obj,export_directory):
       obj.Activate()
       # export_directory = wbjn.ExecuteCommand(ExtAPI,'returnValue(GetUserFilesDirectory())')
       filename = os.path.join(export_directory,'{}.avz'.format(obj.Name))
       ExtAPI.Graphics.Export3D(filename)
       return filename
    

    This was taken from this blog post, which you might find useful.