How to export Ansys Viewer Files (.avz) for each Design Point?

Options
Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 804
First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member

How to export ansys viewer files from mechanical when mechanical is executed as part of a design point run? Export should be done to user files directory and the file name should include a reference to the design point it was generated from.

Tagged:

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 804
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Options
    import wbjn
    import os
    userdirectory=wbjn.ExecuteCommand(ExtAPI,'returnValue(GetUserFilesDirectory())')
    results=ExtAPI.DataModel.GetObjectsByType(DataModelObjectCategory.Result)
    dpn = wbjn.ExecuteCommand(ExtAPI,"returnValue(a+Parameters.GetActiveDesignPoint().Name)",a="DP")
    for result in results:
        result.Activate()
        mvm=ExtAPI.Graphics.ModelViewManager
        avzFilename=os.path.join(userdirectory,'{}{}.avz'.format(result.Name,dpn))
        mvm.Capture3DImage(avzFilename)