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.
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)