Script Format

This section defines the location for the Design Assessment post processing scripts and also defines what values can be accessed in this Design Assessment system. The scripts are to be written using the Python scripting language.

There are three Design Assessment specific system environment variables that can be used when specifying script paths:

DAPROGFILES

Default: C:\Program Files

DANSYSDIR

Default: C:\Program Files\ANSYS Inc\v182

DAUSERFILES

The Workbench project user_files subfolder

The Solve tag defines the location of the script that will be run upon pressing the solve button within the Mechanical application. The Evaluate tag defines the location of the script that will be run when evaluating the DAResult objects. The Evaluate script will be run by default after the solve script when solve has been selected. This separation enables the ability for any intensive processing to be performed and saved to files during the solve stage and then results extraction and presentation to be scripted during the evaluation stage. Alternatively, you may want all the processing performed during the evaluate script and enter None in the Solve Script section.

Additional tags allow you to:

<DAScripts ObjId="4" Type="DAScripts" Ver="2"/>
<!--analysis script language & contents; used to define a script covering 
how the design assessment will be performed and a script used to obtain results-->
  <Solve PropType="string">"c:\mysolve.py"</Solve>
  <Evaluate PropType="string">"c:\myevaluate.py"</Evaluate>
  <DAData PropType="int">1</DAData>
  <CombResults PropType="int">1</CombResults>
  <CombExtra PropType="vector&lt;string>">Extra 1,Extra 2,Extra 3</CombExtra>
  <CombTypes PropType="vector&lt;unsigned int>">1,2,3,4,5,6,7</CombTypes>
lt;/DAScripts>

The DAScripts tag properties should be set as follows:

PropertyValueMeaning
ObjIdenter an integerNumber identifying this script set
TypeDAScriptsSignifies that the contents of the DAScripts tag define solve and evaluate postprocessing scripts
Verenter an integerVersion of the DAScripts tag; this should be set to 2

The following tags can be included as children of a DAScripts tag:

PropertyValueMeaning
Solveenter a string

Path to the file called during the solution; a relative path can be entered. A relative path will be relative to {install}\aisol\bin\{platform}, so for example, ..\..\..\My_Solve.py would need to be located in the same folder as the installation.

Standard environment variables or one of the Design Assessment specific environment variables may be used in the path (enclosed in percent signs). For example:

%TEMP%\My_solve.py

%DAPROGFILES%\My_solve.py

If no solve script is required, the keyword None can be entered.

Evaluateenter a stringPath to the file called during the evaluate. As per the Solve string, this can be relative or use standard environment variables or the Design Assessment specific environment variables.
DADataenter either 1 or 0 Set to 0 to prevent any DA Data (Attribute Groups or DA Results) from being added to the project, or 1 to allow them
CombResultsenter either 1 or 0Set to 0 to prevent Mechanical Results objects from being added to the Design Assessment Solution, or 1 to allow them
CombExtraenter a comma separated list of stringsEnter a string for each extra column heading that you want to appear in the Solution Selection Worksheet.

CombTypes

enter a comma separated list of positive numbers between 1 and 7

Each of the numbers represents a system type. Only system types in this list will be permitted to be selected in the Solution Selections table. The numbers correspond to the systems as follows:

1: Static Structural

2: Transient Structural

3: Explicit Dynamics

4: Modal

5: Harmonic Response

6: Random Vibration

7: Response Spectrum

If CombTypes is not defined, there will be no restrictions applied.

The PropType property of the Solve and Evaluate tags must be set to string, The PropType property of the DAData and CombResults tags must be set to int, and the PropType property of the CombExtra tag must be set to vector&lt;string> and the PropType property of the CombTypes tag must be set to vector&lt;unsigned int>.


Release 18.2 - © ANSYS, Inc. All rights reserved.