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

filePy Customization

Table of contents

Report Generator can be customized in a number of ways. The files that can be modified by the user are described in the following sections. The files are located in the app installation folder. When an app is installed (WB>Extensions>Install Extension…) it is placed in the user profile and can be located by typing “%appdata%” in the Explorer path and then navigate to the corresponding app folder, e.g. “/Ansys/v251/ACT/extensions/EDRMedeso Report Generator 2025R1.2/”.

“/Ansys/v251” <=> Ansys 2025R1).

appdata

extensions

licIcon Maintenance of custom versions

The global version of Report Generator can be updated with the customization files for customer specific versions.

In addition to the Word template and the style preference file reportGeneratorPref.py the automation and customization are defined in the file reportGeneratorDiacritics.py.

In a multi-user organization the app administrator installs the Report Generator app first and adds the customization files and then shares this app installation according to the instructions on page; “Multi-user deployment of apps - Network” in App and Licence Client Installation instructions.

Make sure to include any new preference options and Word VBA macros defined in the official version described in the following sections.

EDRMedeso can offer the service to create a customer specific version of the app and deliver the customization files to the customer in order to use it in current and future versions. Use “Contact Support” in the “Help” menu for more information or to request a quotation for customization.

filePy reportGeneratorPref.py

The global default report settings are defined in the file “reportGeneratorPref.py” and this file is used when adding the Report Settings object.

Changes made in the Report Settings object can be saved back the the file without the need of manual editing the file itself.

In older versions of the app the settings are described on the page Open Preference.

filePy reportGeneratorDiacritics.py

The language support, fonts, colours, special characters, html tags and custom text identifiers are defined in the file “reportGeneratorDiacritics.py”.

Table Style Settings

Options for table line is defined by the “tableStyleDict” parameter.

TableStyle

Font Style Settings

The available font names and sizes are defined in the “textFontDict” parameter. The fonts are defined with the default language “EN-US”. If a different display language is used then the language in the report is updated to match, e.g. “lang=DE”.

FontStyle

Table Headerline Colour

The available colour names are defined in the “colourMap” parameter. Colours that reverse text colours are defined in the “reverseTextColourList”.

ColourMap

Format Comment

Conversion of text identifiers for text formatting and Greek letter replacement is managed by the dictionary “textFormatDict”.

formatComment

Diacritics

Regional characters and special symbols are managed by the dictionary “diacriticsDict” that converts the text to corresponding html symbol.

diacritics1

Language settings

The display language of Workbench is used if “languagePath = None”. The selected display language sets text language in the report automatically.

The Workbench language is defined in the “Tools>Options” window:

language

languageGUI

languageSettings

wordicon ReportGenerator.dotm

The included Microsoft Word template uses VBA macros to execute the import and field conversion actions. When a new document is created the macro Document_New() is called.

The Project Details in the Report Settings object defines the mapping of properties between Mechanical and Word.

The project details and report name is imported from the file “reportGenerator.inp” that is created when “Create Report” is clicked.

One feature is automatic conversion of text to fields. Any text in the report between “{ }” will be treated as a field string.

Macro - Document_New

Macro that is called when a new Word document is created from the Word template.
Update your customer template with the updates/modifications to make the new Table Caption Style and Figure Caption Style active.

Document_New

Macro that break existing links to images.

breakLinks

Macro - CallTextToFields

Macro that takes current selection and calls macro “TextToFields”.

CallTextToFields

Macro - TextToFields

Macro that converts a field text to a field object.

TextToFields

Function - GetField

Function that identifies a field text and creates the field object.

GetField

filePy Workbench journaling (Legacy)

  • The report can be automatically exported from a selected analysis system by using Workbench journaling. (The Batch Report feature replaces the need for using journaling.)

  • Identify the System ID (“SYS 2” in this case) and add the lines below to your script (myJournal.wbjn). You may edit the report name using the yellow lines (optional).

  • The journaling script may be used from the project page:

    “File > Scripting > Run Script File…”

  • The journaling script can be added when running Workbench in batch from command prompt:

    “C:\Program Files\ANSYS Inc\V222\Framework\bin\win64\runwb2” –X –R myJournal.wbjn

journaling

Mechanical must be able to open in interactive mode and Word must be installed on the PC if using the batch option.