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

Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
100 Answers 500 Comments 250 Likes First Anniversary
✭✭✭✭

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: 871
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭
    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)