These guidelines describe the Design Assessment API. Included with the standard ANSYS Workbench installation is the IronPython scripting environment that allows a Python script to be run. Within Design Assessment scripts can be run upon Solve and Evaluate. These Python based scripts have a DesignAssessment object defined as an entry point to access to the API functions to enable data to be processed either directly in python, or externally by calling 3rd party programs.
The following API classes are available:
The API is structured as shown in this diagram:

Every effort is made to ensure compatibility of the API across versions. However, there are occasions where functions or properties need to be modified. In these scenarios, the existing function will be deprecated, i.e. it will become undocumented.
Any data output via the print command will be added to the appropriate script output file which can be reviewed via the Solution Information object. If a deprecated function is called a message will be added to the appropriate script output file with a suggested alternative methodology. These can be viewed via the Solution Information object. This inclusion of the message in the file can be controlled by the OutputDeprecatedWarnings function in the DesignAssessment class. Additional text output from your script can be included in a file that is displayed using the Solver Output option (see Helper class, ReplaceSolverOutputFile).
Undocumented functions (including those recently deprecated) may be removed or altered in subsequent releases if it becomes impractical to maintain a backwards compatible interface, so effort should be made to update any calls to deprecated functions.
Functions may not work on previous releases; therefore, all users should use the same release of Workbench to ensure compatibility.
No functions were deprecated or modified with this release. Newly added functions are not detailed here, but were mainly contained within the Solution class.
Release 14 represents the first release after the initial version. In response to feedback, we have made a number of changes of functions to properties where appropriate, hence there are an unusually high number of deprecated functions. These changes are tabulated below, grouped by class name. The tables do not include newly added functions.
Design Assessment Class:
| Method/Property | Description of Change |
|---|---|
|
getHelper() |
Changed to property Helper, old code: DesignAssessment.getHelper(), new code DesignAssessment.Helper |
|
GeometryMeshData() |
Changed to property MeshData, old code: DesignAssessment.GeometryMeshData(), new code DesignAssessment.MeshData |
|
Selections() |
Changed name to SolutionSelections() to be consistent with the Mechanical application |
|
Selection(int Index) |
Duplication of python functionality. Old code DesignAssessment.SolutionSelection(0), new code MyArray = DesignAssessment.SolutionSelections() then MyArray[0] (NB, using the shortcut DesignAssessment.SolutionSelections()[index] in a loop is less efficient than assigning it to an array within python) |
|
ResultGroups() |
Changed name to DAResults() to be consistent with the Mechanical application |
|
ResultGroup(int Index) |
Duplication of python functionality. Old code DesignAssessment.DAResult(0), new code MyArray = DesignAssessment.DAResults() then MyArray[0] (NB, using the shortcut DesignAssessment.DAResults()[index] in a loop is less efficient than assigning it to an array within python) |
|
NoOfAttributeGroups() |
Changed to property AttributeGroupCount, old code: DesignAssessment.NoOfAttributeGroups(), new code DesignAssessment.AttributeGroupCount |
|
NoOfSelections() |
Changed to property SolutionSelectionCount, old code: DesignAssessment.NoOfSelections(), new code DesignAssessment.SolutionSelectionCount |
|
NoOfResultGroups() |
Changed to property DAResultCount, old code: DesignAssessment. NoOfResultGroups(), new code DesignAssessment.DAResultCount |
|
ProjectName() |
Changed to property ProjectTitle, old code: DesignAssessment. ProjectName(), new code DesignAssessment.ProjectTitle |
|
AttributeGroup(int Index) |
Duplication of python functionality. Old code DesignAssessment.AttributeGroup(0), new code MyArray = DesignAssessment.AttributeGroups() then MyArray[0] (NB, using the shortcut DesignAssessment.AttributeGroups()[index] in a loop is less efficient than assigning it to an array within python) |
Helper Class:
A number of functions related to an internal file, the CAERep, were previously documented in error. These have been removed from the documentation; it is not recommended that these are used as the file structure is subject to change.
| Function/Property | Description of Change |
|---|---|
|
getUnits() |
Replaced by property Units in the DesignAssessment class, for the units set for the Design Assessment System and also the property Units in the Solution class for the units system used in upstream solution. |
|
getSolverOut() |
Changed to property SolverOutputFilePath, old code: Helper.getSolverOut(), new code Helper.SolverOutputFilePath |
|
getOutputFile() |
Changed to property SystemDirectory, old code: Helper.getOutputFile(), new code Helper.SystemDirectory |
|
getGeometryPath () |
Changed to property GeometryPath, old code: Helper. getGeometryPath (), new code Helper.GeometryPath |
|
getResultPath () |
Changed to property ResultPath, old code: Helper.getResultPath(), new code Helper.ResultPath |
|
getSystemDirectory () |
Changed to property SystemDirectory, old code: Helper.getSystemDirectory(), new code Helper.SystemDirectory |
|
getLogFile() |
Removed as the log file can be displayed via Solution Information and its contents can be added to via the standard python print function |
|
WriteToLog () |
Removed as the log file contents can be added to via the standard python print function |
MeshData Class (previously named GeometryMeshData):
A number of functions related to an internal reference, the TopologyID, were previously documented in error. These have been removed from the documentation.
| Method/Property | Description of Change |
|---|---|
|
NoOfNodes() |
Changed to property NodeCount, old code: MeshData. NoOfNodes(), new code MeshData.NodeCount |
|
NoOfElements() |
Changed to property ElementCount, old code: MeshData.NoOfElements(), new code MeshData.ElementCount |
|
ElementbyID(int ID) |
Corrected capitalization, old code: MeshData.ElementbyID(Id), new code MeshData.ElementById(Id) |
|
NodebyID(int ID) |
Corrected capitalization, old code: MeshData.NodebyID(Id), new code MeshData.NodeById(Id) |
|
getConnectedElementIDs (int ID) |
Removed as incorrectly located and duplicated functionality; the method should be the responsibility of the Node object, old code: MeshData.getConnectedElementIDs(Id), new code MeshData.NodeById(Id).ConnectedElementIds() |
|
getConnectedElements (int ID) |
Removed as incorrectly located and duplicated functionality; the method should be the responsibility of the Node object, old code: MeshData.getConnectedElementIDs(ID), new code MeshData.NodeById(Id).ConnectedElements() |
|
getElementsByID(int[] ID) |
Consistency issue, old code: MeshData.getElementsByID (ID[]), new code MeshData.ElementsByIds(ID[]) |
|
Element(int Index) |
Duplication of python functionality. Old code MeshData.Element(0), new code MyArray = MeshData.Elements() then MyArray[0] (NB, using the shortcut MeshData.Elements()[index] in a loop is less efficient than assigning it to an array within python) |
|
Node(int Index) |
Duplication of python functionality. Old code MeshData.Node(0), new code MyArray = MeshData.Nodes() then MyArray[0] (NB, using the shortcut MeshData.Nodes()[index] in a loop is less efficient than assigning it to an array within python) |
DAElement Class:
The function TopologyID() related to an internal reference was previously documented in error. This has been removed from the documentation.
| Method/Property | Description of Change |
|---|---|
|
Type() |
Replaced with property Description, this provides a text description of the element, rather than an internal number which was subject to change, old code: DAElement.Type(), new code DAElement.Description |
|
SectionData() |
Changed to property CrossSectionData, old code: DAElement.SectionData(), new code DAElement.CrossSectionData |
|
getNodeIDs() |
Consistency issue, old code: DAElement.getNodeIDs(), new code DAElement.NodeIds() |
|
ID() |
Changed to property Id, old code: DAElement.ID(), new code DAElement.Id |
|
NoOfConnectedNodes() |
Changed to property NodeCount, old code: DAElement.NoOfConnectedNodes(), new code DAElement.NodeCount |
DANode Class:
| Method/Property | Description of Change |
|---|---|
|
ID() |
Changed to property Id, old code: DANode.ID(), new code DANode.Id |
|
x() |
Changed to property X, old code: DANode.x(), new code DANode.X |
|
y() |
Changed to property Y, old code: DANode.y(), new code DANode.Y |
|
z() |
Changed to property Z, old code: DANode.z(), new code DANode.Z |
|
NoOfConnectedElements() |
Changed to property ConnectedElementCount, old code: DANode.NoOfConnectedElements(), new code DANode.ConnectedElementCount |
|
ConnectedElementIDs() |
Corrected capitalization, old code: DANode.ConnectedElementIDs(Id), new code DANode.ConnectedElementIds(Id) |
SectionData Class:
| Method/Property | Description of Change |
|---|---|
|
Type() |
Replaced with property Description, this provides a text description of the element, rather than an internal number which was subject to change, old code: SectionData.Type(), new code SectionData.Description |
|
Diameter() |
Changed to property TubeDiameter, old code: SectionData.Diameter(), new code SectionData.TubeDiameter |
|
Thickness() |
Changed to property TubeThickness, old code: SectionData.Thickness(), new code SectionData.TubeThickness |
|
WebThickness() |
Changed to property BeamWebThickness, old code: SectionData.WebThickness(), new code SectionData.BeamWebThickness |
|
FlangeThickness() |
Changed to property BeamFlangeThickness, old code: SectionData.FlangeThickness(), new code SectionData.BeamFlangeThickness |
|
FilletRadii() |
Changed to property BeamFilletRadii, old code: SectionData.FilletRadii(), new code SectionData.BeamFilletRadii |
|
Height() |
Changed to property BeamHeight, old code: SectionData.Height(), new code SectionData.BeamHeight |
|
Width() |
Changed to property BeamWidth, old code: SectionData.Width(), new code SectionData.BeamWidth |
AttributeGroup Class:
| Method/Property | Description of Change |
|---|---|
|
NoOfAttributes() |
Changed to property AttributeCount, old code: AttributeGroup.NoOfAttributes(), new code AttributeGroup.AttributeCount |
|
Name() |
Changed to property TreeName, old code: AttributeGroup.Name(), new code AttributeGroup.TreeName |
|
Type() |
Changed to property XmlType, old code: AttributeGroup.Type(), new code AttributeGroup.XmlType |
|
SubType() |
Changed to property XmlSubType, old code: AttributeGroup.SubType(), new code AttributeGroup.XmlSubType |
Attribute Class:
| Method/Property | Description of Change |
|---|---|
|
Name() |
Changed to property AttributeName, old code: Attribute.Name(), new code Attribute.AttributeName |
|
Value() |
Replaced with the properties ValueAsInt, ValueAsDouble, ValueAsString in order to simplify the interface, old code: ValueObj = Attribute.Value() then ValueObj.GetAsInt(), new code: Attribute.ValueAsInt |
|
getNoOfSelectedElements() |
Changed to property SelectedElementCount, old code: Attribute.getNoOfSelectedElements(), new code Attribute.SelectedElementCount |
|
getSelectedElements() |
Consistency issue, old code: Attribute.getSelectedElements(), new code Attribute.SelectedElements() |
|
getNoOfSelectedNodes() |
Changed to property SelectedNodeCount, old code: Attribute.getNoOfSelectedNodes(), new code Attribute.SelectedNodeCount |
|
getSelectedNodes() |
Consistency issue, old code: Attribute.getSelectedNodes(), new code Attribute.SelectedNodes() |
SolutionSelection Class (previously named Selection):
| Method/Property | Description of Change |
|---|---|
|
NoOfSolutions() |
Changed to property SolutionCount, old code: Selection.NoOfSolutions(), new code SolutionSelection.SolutionCount |
|
Solution(int index) |
Replaced with method SolutionByRow(int Row), Row is 1 based. Old code: Selection.Solution(0), new code SolutionSelection.SolutionByRow(1) |
Solution Class:
| Method/Property | Description of Change |
|---|---|
|
NoOfAdditionalSolutionData() |
Changed to property AdditionalSolutionDataCount, old code: Solution.NoOfAdditionalSolutionData(), new code Solution.AdditionalSolutionDataCount |
|
EnvironmentName() |
Changed to property Id, old code: Solution.EnvironmentName(), new code Solution.Id |
|
getResult() |
This method and the object it returned have been removed and the objects functions replaced with properties within the Solution Class. Old code: Solution.getResult().ResultFilePath(), new code: Solution.ResultFilePath |
|
AdditionalSolutionData(int Index) |
Replaced with method AdditionalSolutionDataByColumn (int Col), Col is 1 based. Old code: Solution. AdditionalSolutionData(0), new code Solution.AdditionalSolutionDataByColumn(1) |
SolutionResult Class:
| Method/Property | Description of Change |
|---|---|
|
ResultFilePath() |
Function moved to SolutionClass. Old code: Solution.getResult().ResultFilePath(), new code: Solution.ResultFilePath |
DAResult Class (previously named ResultGroup):
| Method/Property | Description of Change |
|---|---|
|
Name() |
Changed to property TreeName, old code: ResultGroup.Name(), new code DAResult.TreeName |
|
Type() |
Changed to property XmlType, old code: ResultGroup.Type(), new code DAResult.XmlType |
|
AddStepResult() |
Renamed to AddDAResultSet, old code: ResultGroup.AddStepResult(), new code DAResult.AddDAResultSet() |
|
AddStepResult(Result myResult) |
Function has been removed, use AddDAResultSet to create the DAResultSet object then define values within that object. |
|
StepResult() |
Renamed to DAResultSets(), old code: ResultGroup.StepResult(), new code DAResult.DAResultSets() |
|
StepResult(int index) |
Renamed to DAResultSet(), old code: ResultGroup.StepResult(index), new code DAResult.DAResultSet(SetNumber). Note: SetNumber is 1 based. |
|
NoOfAttributes() |
Changed to property AttributeCount, old code: ResultGroup.NoOfAttributes(), new code DAResult. AttributeCount |
DAResultSet Class (previously named Result):
| Method/Property | Description of Change |
|---|---|
|
AddElementResultValue(ValueStructureClass newElementResultValue) |
Modified so that it’s easier to create sets of result values. Now element result values can be directly defined using SetElementalValue. Old code Result.AddElementValue(ValueStructure), new code: DAResultSet.SetElementalValue(ElementID, Component, Value) |
|
ValueStructureClass AddElementResultValue() |
The ValueStructure class has been deprecated as the result values can be accessed directly. Values are also now added with a given ElementID, so numerous entries need not be made. Old code ValueStructure = Result.AddElementValue() then ValueStructure.setValue(Value), new code: DAResultSet.SetElementalValue(ElementID, Component, Value) |
|
ValueStructureClass[] ElementResultValues() |
The ValueStructure class has been deprecated as the result values can be accessed directly for the given element. It is no longer possible to get all the values out as an Array, but values can be obtained via GetElementalValue(ElementID, Component) instead. |
|
ValueStructureClass ElementResultValue(int index) |
The ValueStructure class has been deprecated as the result values can be accessed directly for the given element. Values are also now added with a given ElementID. Old code ValueStructure = Result. ElementResultValue(Index) then Value = ValueStructure.GetAsDouble(), new code: Value = DAResultSet.GetElementalValue(ElementID, Component) |
ValueStructure Class:
This class has been deprecated; all functionality is now redundant as the values can either be obtained or set directly.