2.8.2. Accessing Results using Python

The following two functions have been added to the axl32 and axl64 dll’s to allow access to the database from within a python scripting environment, such as the one used with Design Assessment.

The Python scripts (located in the \v182\asas\DesignAssessment folder in the ANSYS installation) provided as part of the Design Assessment Beamcheck capability can be modified to your requirements: for example, to incorporate further analysis of results and presentation of specific requirements

pyGetElementersultFlt

pyGetElementersultFlt(project,pyelement,pyload,pysubset,pyrestype,pyrescomp,byref(result),byref(intorreal),pysurface,pynode,pyrespos,pyFltType,pyFltReturn)

This is similar to the function GetElementersultFlt, and the inputs/outputs are detailed below. It allows access to obtain a specific result on a specific element of the model. If the same result is to be obtained for all elements, and fine control over exactly what is retrieved is needed, pyGetElementersultArray should be used for efficiency.

NameTypeDescription
projectc_char_pThe path to the project; for example, c:\MyProject\ThisProject;MECH;MECH would look for the MECH10 and MECH45 files in the folder c:\MyProject\ThisProject
pyelementc_longElement number; use -1 to filter over all elements
pyloadc_longLoadcase/loadset number; use -1 to filter over all loadcases
pysubsetc_longLoad subset; use -1 to filter over all subsets
pyrestype c_char_pResult Type; see ASAS Database manual for details
pyrescompc_char_pResult Component; see ASAS Database manual for details
resultc_doubleOutput, passed by reference (i.e. use byref()); this is the result value returned
intorrealc_longOutput, passed by reference; 1 if it’s a number, 0 if it’s a text result
pysurfacec_longSurface on which the result is to be obtained; use -1 to filter over all surfaces
pynodec_longLocal element node that the result is to be obtained; use -1 to filter over all nodes
pyresposc_longResult position; only used for FATJACK, to indicate the interval
pyFltTypec_long

Type of filtering to use:

1 – max

2 – min

3 – abs max

4 – abs min

pyFltReturnc_long

Result item to return:

1 – value

2 – element number at which value can be found

3 – loadcase/loadset at which the value can be found

4 – load subset at which the value can be found

5 – Surface at which the value can be found

6 – local node at which the value can be found

pyGetElementersultArray

pyGetElementersultArray(project,pyFirstload,pyLastload,pyConstantLoad,pyIsLC,pyStepsElems,pyrestype,pyrescomp, pyrespos,byref(Resrecord),byref(LCrecord),byref(Elrecord))

This function enables a result for all the elements in the model to be obtained. The maximum value of the result over each node and surface is always selected. If finer control is required, then pyGetElementersultFlt can be used.

NameTypeDescription
projectc_char_pThe path to the project; for example, c:\MyProject\ThisProject;MECH;MECH would look for the MECH10 and MECH45 files in the folder c:\MyProject\ThisProject.
pyFirstloadc_longFirst loadcase/loadset (if pyIsLC is true) or subset (if pyIsLC is false) to loop from.
pyLastloadc_longLast loadcase/loadset (if pyIsLC is true) or subset (if pyIsLC is false) to loop to.
pyConstantLoadc_longConstant loadcase/loadset (if pyIsLC is false) or subset (if pyIsLC is true).
pyIsLCc_boolUsed in conjunction with pyFirstLoad, pyLastLoad and pyConstantLoad to control the contents and size of the results being obtained.
pyStepsElemsc_longSize of the arrays that are populated with results; typically number of elements * (pyLastload- pyFirstload).
pyrestypec_char_pResult Type; see ASAS Database manual for details.
pyrescomp c_char_pResult Component; see ASAS Database manual for details.
pyresposc_longResult position; only used for FATJACK, to indicate the interval.
Resrecordarray of c_doubles, the size of pyStepsElemsPassed by reference; values returned by function will be available here. The array needs to have the double value defined in a class; see the FATJACK or BEAMST evaluate python script for an example.
LCrecordarray of c_doubles, the size of pyStepsElemsPassed by reference; corresponding loadcase or subset (determined by pyIsLC) returned by function will be available here.
Elrecordarray of c_doubles, the size of pyStepsElemsPassed by reference; corresponding element returned by function will be available here.

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