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(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.
| Name | Type | Description |
|---|---|---|
| project | c_char_p | The 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 |
| pyelement | c_long | Element number; use -1 to filter over all elements |
| pyload | c_long | Loadcase/loadset number; use -1 to filter over all loadcases |
| pysubset | c_long | Load subset; use -1 to filter over all subsets |
| pyrestype | c_char_p | Result Type; see ASAS Database manual for details |
| pyrescomp | c_char_p | Result Component; see ASAS Database manual for details |
| result | c_double | Output, passed by reference (i.e. use byref()); this is the result value returned |
| intorreal | c_long | Output, passed by reference; 1 if it’s a number, 0 if it’s a text result |
| pysurface | c_long | Surface on which the result is to be obtained; use -1 to filter over all surfaces |
| pynode | c_long | Local element node that the result is to be obtained; use -1 to filter over all nodes |
| pyrespos | c_long | Result position; only used for FATJACK, to indicate the interval |
| pyFltType | c_long |
Type of filtering to use: 1 – max 2 – min 3 – abs max 4 – abs min |
| pyFltReturn | c_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(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.
| Name | Type | Description |
|---|---|---|
| project | c_char_p | The 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. |
| pyFirstload | c_long | First loadcase/loadset (if pyIsLC is true) or subset (if pyIsLC is false) to loop from. |
| pyLastload | c_long | Last loadcase/loadset (if pyIsLC is true) or subset (if pyIsLC is false) to loop to. |
| pyConstantLoad | c_long | Constant loadcase/loadset (if pyIsLC is false) or subset (if pyIsLC is true). |
| pyIsLC | c_bool | Used in conjunction with pyFirstLoad, pyLastLoad and pyConstantLoad to control the contents and size of the results being obtained. |
| pyStepsElems | c_long | Size of the arrays that are populated with results; typically number of elements * (pyLastload- pyFirstload). |
| pyrestype | c_char_p | Result Type; see ASAS Database manual for details. |
| pyrescomp | c_char_p | Result Component; see ASAS Database manual for details. |
| pyrespos | c_long | Result position; only used for FATJACK, to indicate the interval. |
| Resrecord | array of c_doubles, the size of pyStepsElems | Passed 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. |
| LCrecord | array of c_doubles, the size of pyStepsElems | Passed by reference; corresponding loadcase or subset (determined by pyIsLC) returned by function will be available here. |
| Elrecord | array of c_doubles, the size of pyStepsElems | Passed by reference; corresponding element returned by function will be available here. |