Skip to main content Link Menu Expand (external link) Document Search Copy Copied

filePy Open Preference (Legacy)

Table of contents

About

The “Open Preference” is the legacy way of customizing the current report and/or the default properties. Starting in V231.3 this feature and documentation is replaced by the new Report Settings object.

Local Preference

Click “Open Preference” to insert a copy of the current “reportGeneratorPref” settings for Word template and automatic summary tables to the project. This allows to select the Word template to use and turn on/off individual summary tables without changing the global settings.

local

To revert to the global settings simply delete the preference comment or “un-tag” it from “Report”.

Global Preference

Click “Open Preference” again to open the preference file if you want to make permanent changes in the file. The preference files are located in the app installation folder (%appdata%\Ansys\v2XY\ACT\extensions\ReportGenerator_V2XY.Z).

You may have to assign a default action for file type “.py” in Windows so it opens in a text editor and not tries to run the file in a Python terminal.

openPy

Word template file

The included Word template can be edited by the user to modify front page, heading styles etc. The template is saved in the extension folder, e.g. %appdata%\Ansys\v231\ACT\extensions\Report Generator V231.1.

The template uses Visual Basic to work together with Mechanical!

You may have several different Word templates in the extension folder. You activate the template to use with the parameter “name_dotm”.

wordTemplate

Default Report folder

The default report save location is the projects “user_files”. This is defined by the parameter “report_path”.

To disable the question to overwrite an existing report set “report_overwrite = True”.

To disable the Word template paragraph font and use the styles defined in the preference file set “use_Word_template_font = True”.

path

The prompt to not overwrite also requires that the “reportGeneratorCustom.py” is updated if migrating an older version of the file!

doExport

Automatic summary tables

The following summary tables are available to include in the report as default.

table

Style preferences

Additional style settings for caption, table borders, font, background color as well as heading, paragraph, caption and UCO style is defined in this file using HTML5 style syntax.

html5

In “heading_font”, “paragraph_font”, “table_font” and “uco_font” the “escape” symbol “\” is needed to make it a valid string definition in Python.

Image Export Settings

Define Image export settings from Mechanical Options window (File>Options…) or in the preference file under “Image export settings”.

Graphics

  • Capture: “Image and Legend” or “Image”.
  • Background: “Graphic Appearance Settings” or “White”.
  • Current Graphics Display: “Yes” (use screen capture) “No” (use these settings)
  • Font Magnification Factor: To scale font size in figures.

export

Report

  • Chart Width and Height: Chart size (in Pixels)
  • Graphics Width and Height: Figure size (and aspect ratio)
  • Graphics Resolution: Scale width and height by this factor.

export

Word uses 96 dpi resolution so if the document width is e.g. 17 cm the graphics width should be: 96*(17/2.54) = 640.

Image preference settings

In the preference file common settings may be defined to override the Mechanical Options.

If “useMechanicalOptions” is undefined or “True” the existing settings in the “Options” dialog are used.

export