You are on page 1of 102

ANSYS Workbench Application Customization

Toolkit

ANSYS, Inc. Release 14.5


Southpointe October 2012
275 Technology Drive ANSYS Customization Suite
Canonsburg, PA 15317 ANSYS, Inc. is
ansysinfo@ansys.com certified to ISO
9001:2008.
http://www.ansys.com
(T) 724-746-3304
(F) 724-514-9494
Copyright and Trademark Information

© 2012 SAS IP, Inc. All rights reserved. Unauthorized use, distribution or duplication is prohibited.

ANSYS, ANSYS Workbench, Ansoft, AUTODYN, EKM, Engineering Knowledge Manager, CFX, FLUENT, HFSS and any
and all ANSYS, Inc. brand, product, service and feature names, logos and slogans are registered trademarks or
trademarks of ANSYS, Inc. or its subsidiaries in the United States or other countries. ICEM CFD is a trademark used
by ANSYS, Inc. under license. CFX is a trademark of Sony Corporation in Japan. All other brand, product, service
and feature names or trademarks are the property of their respective owners.

Disclaimer Notice

THIS ANSYS SOFTWARE PRODUCT AND PROGRAM DOCUMENTATION INCLUDE TRADE SECRETS AND ARE CONFID-
ENTIAL AND PROPRIETARY PRODUCTS OF ANSYS, INC., ITS SUBSIDIARIES, OR LICENSORS. The software products
and documentation are furnished by ANSYS, Inc., its subsidiaries, or affiliates under a software license agreement
that contains provisions concerning non-disclosure, copying, length and nature of use, compliance with exporting
laws, warranties, disclaimers, limitations of liability, and remedies, and other provisions. The software products
and documentation may be used, disclosed, transferred, or copied only in accordance with the terms and conditions
of that software license agreement.

ANSYS, Inc. is certified to ISO 9001:2008.

U.S. Government Rights

For U.S. Government users, except as specifically granted by the ANSYS, Inc. software license agreement, the use,
duplication, or disclosure by the United States Government is subject to restrictions stated in the ANSYS, Inc.
software license agreement and FAR 12.212 (for non-DOD licenses).

Third-Party Software

See the legal information in the product help files for the complete Legal Notice for ANSYS proprietary software
and third-party software. If you are unable to access the Legal Notice, please contact ANSYS, Inc.

Published in the U.S.A.


Table of Contents
I. Namespaces ............................................................................................................................................. 1
Ansys.AAP.PublicAPIs.Selection Namespace ....................................................................................... 3
ISelectionInfo ................................................................................................................................... 3
Id ............................................................................................................................................... 3
Ids .............................................................................................................................................. 3
Name ......................................................................................................................................... 4
SelectionType ............................................................................................................................. 4
ISelectionMgr ................................................................................................................................... 4
CurrentSelection ........................................................................................................................ 4
AddSelection(SelectionInfo) ....................................................................................................... 4
ClearSelection() .......................................................................................................................... 5
NewSelection(SelectionInfo) ....................................................................................................... 5
SelectionTypeEnum .......................................................................................................................... 5
Ansys.AAP.PublicAPIs.SimData Namespace ......................................................................................... 7
IPropertyCollection .......................................................................................................................... 7
AllDescendants .......................................................................................................................... 8
Count ......................................................................................................................................... 8
GetByNameDictionary ................................................................................................................ 8
Contains(ISimProperty) ............................................................................................................... 8
GetByName(string) ..................................................................................................................... 8
IPropertyContainer ........................................................................................................................... 9
Properties .................................................................................................................................. 9
ISimEntity ......................................................................................................................................... 9
Analysis .................................................................................................................................... 10
Caption .................................................................................................................................... 10
Extension ................................................................................................................................. 10
Icon .......................................................................................................................................... 10
Id ............................................................................................................................................. 10
Name ....................................................................................................................................... 10
State ........................................................................................................................................ 11
GetAttributeValue(string) .......................................................................................................... 11
GetAttributeValueAsString(string) ............................................................................................. 11
SetAttributeValue(string, object) ............................................................................................... 11
ISimLoad ........................................................................................................................................ 12
Color ........................................................................................................................................ 12
IsLoad ...................................................................................................................................... 12
IsSupport ................................................................................................................................. 12
Suppressed .............................................................................................................................. 12
ISimProperty .................................................................................................................................. 13
Caption .................................................................................................................................... 14
Control ..................................................................................................................................... 14
Controller ................................................................................................................................. 14
DefaultValue ............................................................................................................................. 14
Displayed ................................................................................................................................. 14
HasUnit .................................................................................................................................... 14
Id ............................................................................................................................................. 15
InternalValue ............................................................................................................................ 15
IsGroup .................................................................................................................................... 15
IsTable ...................................................................................................................................... 15
IsValid ...................................................................................................................................... 15

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. iii
ANSYS Workbench Application Customization Toolkit

Name ....................................................................................................................................... 16
Options .................................................................................................................................... 16
ParentCaption .......................................................................................................................... 16
ParentPropertyGroup ............................................................................................................... 16
QuantityName .......................................................................................................................... 16
ReadOnly ................................................................................................................................. 16
UniqueName ............................................................................................................................ 17
UnitString ................................................................................................................................. 17
Value ........................................................................................................................................ 17
ValueString ............................................................................................................................... 17
Visible ...................................................................................................................................... 17
GetAttributeValue(string) .......................................................................................................... 17
GetAttributeValueAsString(string) ............................................................................................. 18
ISimPropertyGroup ......................................................................................................................... 18
Display ..................................................................................................................................... 18
ISimPropertyTable .......................................................................................................................... 18
ActiveRow ................................................................................................................................ 19
RowCount ................................................................................................................................ 19
UpdateStateFreq ...................................................................................................................... 19
ValidState ................................................................................................................................. 19
AddRow() ................................................................................................................................. 19
DeleteRow(int) ......................................................................................................................... 20
SaveActiveRow() ....................................................................................................................... 20
ISimResult ...................................................................................................................................... 20
CalculateTimeHistory ................................................................................................................ 20
Location ................................................................................................................................... 21
Suppressed .............................................................................................................................. 21
Type ......................................................................................................................................... 21
Unit .......................................................................................................................................... 21
ISimSolver ...................................................................................................................................... 21
AnalysisType ............................................................................................................................ 22
PhysicsType .............................................................................................................................. 22
LocationTypeEnum ......................................................................................................................... 22
ResultTypeEnum ............................................................................................................................. 22
UpdateStateFreqEnum ................................................................................................................... 23
ValidStateEnum .............................................................................................................................. 23
Ansys.AAP.PublicAPIs.Mesh Namespace ............................................................................................ 25
ElementTypeEnum ......................................................................................................................... 25
IElement ......................................................................................................................................... 26
Area ......................................................................................................................................... 26
Centroid ................................................................................................................................... 26
CornerNodeIds ......................................................................................................................... 26
Id ............................................................................................................................................. 27
NodeIds ................................................................................................................................... 27
Type ......................................................................................................................................... 27
Volume .................................................................................................................................... 27
IMeshData ...................................................................................................................................... 27
ElementCount .......................................................................................................................... 28
ElementIds ............................................................................................................................... 28
NodeCount ............................................................................................................................... 28
NodeIds ................................................................................................................................... 28
Unit .......................................................................................................................................... 29

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
iv of ANSYS, Inc. and its subsidiaries and affiliates.
ANSYS Workbench Application Customization Toolkit

ElementById(int) ....................................................................................................................... 29
ElementIdsFromNodeIds(IEnumerable<int>) ............................................................................. 29
MeshRegionById(int) ................................................................................................................ 29
NodeById(int) ........................................................................................................................... 30
NodeIdsFromElementIds(IEnumerable<int>) ............................................................................. 30
IMeshRegion .................................................................................................................................. 30
ElementCount .......................................................................................................................... 31
ElementIds ............................................................................................................................... 31
NodeCount ............................................................................................................................... 31
NodeIds ................................................................................................................................... 31
INode ............................................................................................................................................. 31
ConnectedElementIds .............................................................................................................. 32
Id ............................................................................................................................................. 32
X .............................................................................................................................................. 32
Y .............................................................................................................................................. 32
Z .............................................................................................................................................. 32
Ansys.AAP.PublicAPIs Namespace ...................................................................................................... 33
GeoBodyTypeEnum ........................................................................................................................ 33
GeoCellTypeEnum .......................................................................................................................... 33
GeoCurveTypeEnum ....................................................................................................................... 34
GeoSurfaceTypeEnum .................................................................................................................... 34
IDataModel .................................................................................................................................... 35
AnalysisList ............................................................................................................................... 35
AnalysisNames ......................................................................................................................... 35
GeoData ................................................................................................................................... 36
MeshDataNames ...................................................................................................................... 36
AnalysisById(int) ....................................................................................................................... 36
AnalysisByName(string) ............................................................................................................ 36
CurrentConsistentUnitFromQuantityName(string) ..................................................................... 36
CurrentUnitFromQuantityName(string) ..................................................................................... 37
MeshDataByName(string) ......................................................................................................... 37
ILog ................................................................................................................................................ 37
LogFilename ............................................................................................................................ 38
ViewLog() ................................................................................................................................. 38
WriteError(string) ...................................................................................................................... 38
WriteMessage(string) ................................................................................................................ 38
Ansys.AAP.PublicAPIs.Geometry Namespace .................................................................................... 39
IGeoAssembly ................................................................................................................................ 39
Dimension ................................................................................................................................ 39
Name ....................................................................................................................................... 40
Parts ......................................................................................................................................... 40
Unit .......................................................................................................................................... 40
IGeoBody ....................................................................................................................................... 40
Area ......................................................................................................................................... 41
BodyType ................................................................................................................................. 41
CrossSection ............................................................................................................................ 41
CrossSectionOffset ................................................................................................................... 41
CrossSectionOffsetType ............................................................................................................ 41
Edges ....................................................................................................................................... 42
Faces ........................................................................................................................................ 42
Length ..................................................................................................................................... 42
Material .................................................................................................................................... 42

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. v
ANSYS Workbench Application Customization Toolkit

Name ....................................................................................................................................... 42
Shells ....................................................................................................................................... 42
Suppressed .............................................................................................................................. 43
Thickness ................................................................................................................................. 43
Vertices .................................................................................................................................... 43
Volume .................................................................................................................................... 43
IGeoData ........................................................................................................................................ 43
Assemblies ............................................................................................................................... 44
GeoEntityById(int) .................................................................................................................... 44
IGeoEdge ....................................................................................................................................... 44
CrossSectionOrientation ........................................................................................................... 45
CurveType ................................................................................................................................ 45
EndVertex ................................................................................................................................. 45
Extents ..................................................................................................................................... 45
Faces ........................................................................................................................................ 46
IsParamReversed ...................................................................................................................... 46
Length ..................................................................................................................................... 46
StartVertex ............................................................................................................................... 46
Vertices .................................................................................................................................... 46
ParamAtPoint(double[]) ............................................................................................................ 46
PointAtParam(double) .............................................................................................................. 47
PointsAtParams(double[]) ......................................................................................................... 47
TangentAtParam(double) .......................................................................................................... 47
TangentsAtParams(double[]) ..................................................................................................... 47
IGeoEntity ...................................................................................................................................... 48
Id ............................................................................................................................................. 48
Type ......................................................................................................................................... 48
IGeoFace ........................................................................................................................................ 48
Area ......................................................................................................................................... 49
Body ........................................................................................................................................ 49
Edges ....................................................................................................................................... 49
Loops ....................................................................................................................................... 50
Shell ......................................................................................................................................... 50
SurfaceType ............................................................................................................................. 50
Vertices .................................................................................................................................... 50
NormalAtParam(double, double) ............................................................................................... 50
NormalsAtParams(double[]) ...................................................................................................... 51
ParamAtPoint(double[]) ............................................................................................................ 51
PointAtParam(double, double) .................................................................................................. 51
PointsAtParams(double[]) ......................................................................................................... 51
IGeoLoop ....................................................................................................................................... 52
Edges ....................................................................................................................................... 52
Face ......................................................................................................................................... 52
IGeoPart ......................................................................................................................................... 52
Bodies ...................................................................................................................................... 53
Name ....................................................................................................................................... 53
IGeoShell ........................................................................................................................................ 53
Faces ........................................................................................................................................ 53
IGeoTessellation ............................................................................................................................. 53
FacetCount ............................................................................................................................... 54
Indices ..................................................................................................................................... 54
Normals ................................................................................................................................... 54

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
vi of ANSYS, Inc. and its subsidiaries and affiliates.
ANSYS Workbench Application Customization Toolkit

Points ....................................................................................................................................... 54
IGeoVertex ..................................................................................................................................... 54
Bodies ...................................................................................................................................... 55
Edges ....................................................................................................................................... 55
Faces ........................................................................................................................................ 55
X .............................................................................................................................................. 55
Y .............................................................................................................................................. 56
Z .............................................................................................................................................. 56
Ansys.AAP.PublicAPIs.Results Namespace ......................................................................................... 57
IResult ............................................................................................................................................ 57
Components ............................................................................................................................ 57
Name ....................................................................................................................................... 58
QuantityNames ........................................................................................................................ 58
Units ........................................................................................................................................ 58
ElementValue(int, string) ........................................................................................................... 58
ElementValues(IEnumerable<int>, string) .................................................................................. 58
NodeValue(int, string) ............................................................................................................... 59
NodeValues(IEnumerable<int>, string) ...................................................................................... 59
IResultReader ................................................................................................................................. 59
CurrentResultSet ...................................................................................................................... 60
CurrentTimeFreq ...................................................................................................................... 60
HasImaginaryResults ................................................................................................................ 60
ListTimeFreq ............................................................................................................................. 60
ResultSetCount ......................................................................................................................... 61
ResultsName ............................................................................................................................ 61
Result(string) ............................................................................................................................ 61
Ansys.AAP.PublicAPIs.Analysis Namespace ....................................................................................... 63
CoordinateSystem .......................................................................................................................... 63
CoordinateSystem(CoordinateSystemTypeEnum) ...................................................................... 64
CoordinateSystemType ............................................................................................................. 64
Id ............................................................................................................................................. 64
Matrix ...................................................................................................................................... 64
Name ....................................................................................................................................... 64
Origin ....................................................................................................................................... 65
XAxis ........................................................................................................................................ 65
YAxis ........................................................................................................................................ 65
ZAxis ........................................................................................................................................ 65
CoordinateSystemTypeEnum .......................................................................................................... 65
IAnalysis ......................................................................................................................................... 66
AnalysisType ............................................................................................................................ 67
Components ............................................................................................................................ 67
CoordinateSystems ................................................................................................................... 67
GeoData ................................................................................................................................... 67
Id ............................................................................................................................................. 67
LoadObjects ............................................................................................................................. 68
MeshData ................................................................................................................................. 68
Name ....................................................................................................................................... 68
PhysicsType .............................................................................................................................. 68
PropertyNames ........................................................................................................................ 68
ResultObjects ........................................................................................................................... 68
ResultsData .............................................................................................................................. 69
Solver ....................................................................................................................................... 69

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. vii
ANSYS Workbench Application Customization Toolkit

SolverName .............................................................................................................................. 69
StepsEndTime .......................................................................................................................... 69
WorkingDir ............................................................................................................................... 69
ComponentById(int) ................................................................................................................. 69
CoordinateSystemById(int) ....................................................................................................... 70
CreateLoadObject(string) .......................................................................................................... 70
CreateResultObject(string) ........................................................................................................ 70
CurrentConsistentUnitFromQuantityName(string) ..................................................................... 70
GenerateMesh() ........................................................................................................................ 71
PropertyValue(string) ................................................................................................................ 71
PropertyValue(string, object) ..................................................................................................... 71
Solve(bool) ............................................................................................................................... 71
WriteInputFile(string) ................................................................................................................ 72
IDataObject .................................................................................................................................... 72
Id ............................................................................................................................................. 72
Name ....................................................................................................................................... 73
PropertyNames ........................................................................................................................ 73
Type ......................................................................................................................................... 73
PropertyValue(string) ................................................................................................................ 73
PropertyValue(string, object) ..................................................................................................... 73
IDataObjectCollection .................................................................................................................... 74
Ids ............................................................................................................................................ 74
List ........................................................................................................................................... 74
Names ...................................................................................................................................... 74
GetById(int) .............................................................................................................................. 75
GetByName(string) ................................................................................................................... 75
GetEnumerator() ....................................................................................................................... 75
NamesByType(string) ................................................................................................................ 75
IDataObjectContainer ..................................................................................................................... 76
DataObjects ............................................................................................................................. 76
Ansys.AAP.PublicAPIs.Extension Namespace .................................................................................... 77
IApplication .................................................................................................................................... 77
ScriptNames ............................................................................................................................. 77
LogError(string) ........................................................................................................................ 77
LogWarning(string) ................................................................................................................... 78
ScriptByName(string) ................................................................................................................ 78
IExtension ...................................................................................................................................... 78
Name ....................................................................................................................................... 79
ScriptEngine ............................................................................................................................. 79
ScriptScope .............................................................................................................................. 79
Version ..................................................................................................................................... 79
IExtensionAPI ................................................................................................................................. 79
Application ............................................................................................................................... 80
Context .................................................................................................................................... 80
DataModel ............................................................................................................................... 80
ExtensionMgr ........................................................................................................................... 80
Graphics ................................................................................................................................... 81
Log .......................................................................................................................................... 81
SelectionMgr ............................................................................................................................ 81
LockPrePostLicense() ................................................................................................................ 81
ResultsData(string) ................................................................................................................... 81
UnlockPrePostLicense() ............................................................................................................. 82

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
viii of ANSYS, Inc. and its subsidiaries and affiliates.
ANSYS Workbench Application Customization Toolkit

IExtensionMgr ................................................................................................................................ 82
CurrentExtension ...................................................................................................................... 82
Extensions ................................................................................................................................ 82
Ansys.AAP.PublicAPIs.Graphics Namespace ...................................................................................... 83
IDraw3DContext ............................................................................................................................. 83
Color ........................................................................................................................................ 84
DepthTest ................................................................................................................................ 84
LineWeight ............................................................................................................................... 84
Translucency ............................................................................................................................ 84
Visible ...................................................................................................................................... 84
Close() ...................................................................................................................................... 85
DrawCircle(IEnumerable<double>, double, IEnumerable<double>) ........................................... 85
DrawDisc(IEnumerable<double>, double, IEnumerable<double>) ............................................. 85
DrawPoints(IEnumerable<double>) .......................................................................................... 85
DrawPolygon(IEnumerable<double>, IEnumerable<double>) ................................................... 86
DrawPolyline(IEnumerable<double>) ....................................................................................... 86
DrawShell(IEnumerable<double>, IEnumerable<double>, IEnumerable<int>) ........................... 86
DrawShell(IEnumerable<double>, IEnumerable<double>, IEnumerable<int>, IEnumer-
able<int>) ................................................................................................................................ 87
IGraphics ........................................................................................................................................ 87
Color ........................................................................................................................................ 88
LineWeight ............................................................................................................................... 88
MainHandle .............................................................................................................................. 88
MainWindow ............................................................................................................................ 89
Translucency ............................................................................................................................ 89
CreateAndOpenDraw3DContext() ............................................................................................. 89
DrawText2D(int, int, string) ........................................................................................................ 89
LineTo2D(int, int) ...................................................................................................................... 89
MoveTo2D(int, int) .................................................................................................................... 90
PixelToWorld(IEnumerable<int>) .............................................................................................. 90
PixelToWorld(int, int) ................................................................................................................. 90
WorldToPixel(IEnumerable<double>) ........................................................................................ 91
WorldToPixel(double, double, double) ....................................................................................... 91

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. ix
Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
x of ANSYS, Inc. and its subsidiaries and affiliates.
Part I: Namespaces
Ansys.AAP.PublicAPIs.Selection Namespace
Declaration Syntax
namespace Ansys.AAP.PublicAPIs.Selection

Table 1: Members

ISelectionInfo SelectionInfo class


ISelectionMgr ISelectionMgr Interface
SelectionTypeEnum SelectionTypeEnum enumerator

ISelectionInfo
SelectionInfo class

Declaration Syntax
public interface ISelectionInfo

Table 2: Members

Property Id Gets or sets the ID of this ISelectionInfo object.


Property Ids Gets or sets selected IDs.
Property Name Gets or sets the name of this ISelectionInfo object.
Property SelectionType Gets or sets the selection type.

Id
Gets or sets the ID of this ISelectionInfo object.

Declaration Syntax
public int Id { set;get; }

Ids
Gets or sets selected IDs.

Declaration Syntax
public IList<int> Ids { set;get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 3
Ansys.AAP.PublicAPIs.Selection Namespace

Name
Gets or sets the name of this ISelectionInfo object.

Declaration Syntax
public string Name { set;get; }

SelectionType
Gets or sets the selection type.

Declaration Syntax
public SelectionTypeEnum SelectionType { set;get; }

ISelectionMgr
ISelectionMgr Interface

Declaration Syntax
public interface ISelectionMgr

Table 3: Members

Property CurrentSelection Returns the current SelectionInfo object.


Method AddSelection(SelectionInfo) Adds to the current selection from a Selection-
Info object.
Method ClearSelection() Clears the current selection.
Method NewSelection(SelectionInfo) Creates a new selection from a SelectionInfo
object.

CurrentSelection
Returns the current SelectionInfo object.

Declaration Syntax
public SelectionInfo CurrentSelection { get; }

AddSelection(SelectionInfo)
Adds to the current selection from a SelectionInfo object.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
4 of ANSYS, Inc. and its subsidiaries and affiliates.
SelectionTypeEnum

Declaration Syntax
public void AddSelection(SelectionInfo info)

Parameters
info(SelectionInfo)
The selection data as a SelectionInfo object.

ClearSelection()
Clears the current selection.

Declaration Syntax
public void ClearSelection()

NewSelection(SelectionInfo)
Creates a new selection from a SelectionInfo object.

Declaration Syntax
public void NewSelection(SelectionInfo info)

Parameters
info(SelectionInfo)
The selection data as a SelectionInfo object.

SelectionTypeEnum
SelectionTypeEnum enumerator

Declaration Syntax
public enum SelectionTypeEnum

Table 4: Members

Member GeometryEntities All selected items will be IDs of geometry entities.


Member MeshNodes All selected items will be node IDs.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 5
Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
6 of ANSYS, Inc. and its subsidiaries and affiliates.
Ansys.AAP.PublicAPIs.SimData Namespace
Declaration Syntax
namespace Ansys.AAP.PublicAPIs.SimData

Table 5: Members

IPropertyCollection IPropertiesCollection Interface


IPropertyContainer IPropertyContainer Interface
ISimEntity IEntityObject Interface
ISimLoad ILoadObject Interface
ISimProperty The ISimProperty Interface
ISimPropertyGroup ISimPropertyGroup Interface
ISimPropertyTable ISimPropertyTable Interface
ISimResult IResultObject Interface
ISimSolver ISimSolver Interface
LocationTypeEnum Enumeration to specify result location types
ResultTypeEnum Enumeration to specify result value types
UpdateStateFreqEnum Enumeration to specify update state frequency types
ValidStateEnum Enumeration to specify valid states

IPropertyCollection
IPropertiesCollection Interface

Declaration Syntax
public interface IPropertyCollection

Table 6: Members

Property AllDescendants Returns all properties of this collection and all sub col-
lections.
Property Count Returns the number of properties in the collection.
Property GetByNameDictionary Returns a dictionary where the keys are the property
names and value are the properties.
Method Contains(ISimProperty) Checks if the collection contains the property.
Method GetByName(string) Returns a ISimProperty object by its name.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 7
Ansys.AAP.PublicAPIs.SimData Namespace

AllDescendants
Returns all properties of this collection and all sub collections.

Declaration Syntax
public List<ISimProperty> AllDescendants { get; }

Count
Returns the number of properties in the collection.

Declaration Syntax
public int Count { get; }

GetByNameDictionary
Returns a dictionary where the keys are the property names and value are the properties.

Declaration Syntax
public Dictionary<string, ISimProperty> GetByNameDictionary { get; }

Contains(ISimProperty)
Checks if the collection contains the property.

Declaration Syntax
public bool Contains(ISimProperty property)

Parameters
property(ISimProperty)
The property.

GetByName(string)
Returns a ISimProperty object by its name.

Declaration Syntax
public ISimProperty GetByName(string name)

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
8 of ANSYS, Inc. and its subsidiaries and affiliates.
ISimEntity

Parameters
name(string)
The name.

IPropertyContainer
IPropertyContainer Interface

Declaration Syntax
public interface IPropertyContainer

Table 7: Members

Property Properties Returns the IPropertyCollection object.

Properties
Returns the IPropertyCollection object.

Declaration Syntax
public IPropertyCollection Properties { get; }

ISimEntity
IEntityObject Interface

Declaration Syntax
public interface ISimEntity

Table 8: Members

Property Analysis Returns the associated IAnalysis object.


Property Caption Returns the caption of this entity.
Property Extension Returns the associated IExtension object.
Property Icon Return the icon name of this entity.
Property Id Returns the ID of this entity object.
Property Name Returns the internal name of this entity.
Property State Returns the internal state of this entity.
Method GetAttributeValue(string) Gets an attribute value by its name.
Method GetAttributeValueAsString(string) Gets an attribute value by its name.
Method SetAttributeValue(string, object) Sets an attribute value by its name.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 9
Ansys.AAP.PublicAPIs.SimData Namespace

Analysis
Returns the associated IAnalysis object.

Declaration Syntax
public IAnalysis Analysis { get; }

Caption
Returns the caption of this entity.

Declaration Syntax
public string Caption { get; }

Extension
Returns the associated IExtension object.

Declaration Syntax
public IExtension Extension { get; }

Icon
Return the icon name of this entity.

Declaration Syntax
public string Icon { get; }

Id
Returns the ID of this entity object.

Declaration Syntax
public int Id { get; }

Name
Returns the internal name of this entity.

Declaration Syntax
public string Name { get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
10 of ANSYS, Inc. and its subsidiaries and affiliates.
ISimEntity

State
Returns the internal state of this entity.

Declaration Syntax
public string State { get; }

GetAttributeValue(string)
Gets an attribute value by its name.

Declaration Syntax
public object GetAttributeValue(string attrName)

Parameters
attrName(string)
The name of the attribute.

GetAttributeValueAsString(string)
Gets an attribute value by its name.

Declaration Syntax
public string GetAttributeValueAsString(string attrName)

Parameters
attrName(string)
The name of the attribute.

SetAttributeValue(string, object)
Sets an attribute value by its name.

Declaration Syntax
public void SetAttributeValue(string attrName, object attrValue)

Parameters
attrName(string)
The name of the attribute.

attrValue(object)
The attribute value.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 11
Ansys.AAP.PublicAPIs.SimData Namespace

ISimLoad
ILoadObject Interface

Declaration Syntax
public interface ISimLoad

Table 9: Members

Property Color Returns the color associated with this entity. This color is used
by default to display the scoping region.
Property IsLoad Returns true if this load / boundary condition is acting as a "load"
for the associated analysis.
Property IsSupport Returns true if this load / boundary condition is acting as a
"support" for the associated analysis.
Property Suppressed Gets or Sets the suppression state of this load in the associated
analysis.

Color
Returns the color associated with this entity. This color is used by default to display the scoping region.

Declaration Syntax
public int Color { get; }

IsLoad
Returns true if this load / boundary condition is acting as a "load" for the associated analysis.

Declaration Syntax
public bool IsLoad { get; }

IsSupport
Returns true if this load / boundary condition is acting as a "support" for the associated analysis.

Declaration Syntax
public bool IsSupport { get; }

Suppressed
Gets or Sets the suppression state of this load in the associated analysis.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
12 of ANSYS, Inc. and its subsidiaries and affiliates.
ISimProperty

Declaration Syntax
public bool Suppressed { set;get; }

ISimProperty
The ISimProperty Interface

Declaration Syntax
public interface ISimProperty

Table 10: Members

Property Caption Returns the current caption of the property.


Property Control Returns the control type of the property.
Property Controller Returns the python object which was instantiated with
the class tag in the XML.
Property DefaultValue Gets or sets the default value.
Property Displayed Returns true if the property is displayed.
Property HasUnit Returns true if the property has units.
Property Id Gets the ID of the property.
Property InternalValue Gets or sets the internal value of the property. The In-
ternalValue accessors do not invoke the getvalue call-
back.
Property IsGroup Returns true if the property is an instance of SimProper-
tyGroup.
Property IsTable Returns true if the property is an instance of SimProper-
tyTable.
Property IsValid Returns true if the property is valid.
Property Name Returns the name of the property.
Property Options Gets or sets the options list for the select control.
Property ParentCaption Returns the parent caption of the property.
Property ParentPropertyGroup Returns the parent PropertyGroup.
Property QuantityName Returns the quantity name for this property.
Property ReadOnly Gets or sets the editable state of the property.
Property UniqueName Get or sets a unique name for this property.
Property UnitString Gets the unit string for this property.
Property Value Gets or sets the value for this property.
Property ValueString Gets or sets the value string for this property.
Property Visible Gets or sets the visibility state of the property.
Method GetAttribute- Gets an attribute value by its name.
Value(string)

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 13
Ansys.AAP.PublicAPIs.SimData Namespace

Method GetAttributeValueAs- Gets an attribute value by its name.


String(string)

Caption
Returns the current caption of the property.

Declaration Syntax
public string Caption { set;get; }

Control
Returns the control type of the property.

Declaration Syntax
public string Control { get; }

Controller
Returns the python object which was instantiated with the class tag in the XML.

Declaration Syntax
public object Controller { get; }

DefaultValue
Gets or sets the default value.

Declaration Syntax
public object DefaultValue { set;get; }

Displayed
Returns true if the property is displayed.

Declaration Syntax
public bool Displayed { get; }

HasUnit
Returns true if the property has units.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
14 of ANSYS, Inc. and its subsidiaries and affiliates.
ISimProperty

Declaration Syntax
public bool HasUnit { get; }

Id
Gets the ID of the property.

Declaration Syntax
public int Id { get; }

InternalValue
Gets or sets the internal value of the property. The InternalValue accessors do not invoke the getvalue
callback.

Declaration Syntax
public object InternalValue { set;get; }

IsGroup
Returns true if the property is an instance of SimPropertyGroup.

Declaration Syntax
public bool IsGroup { get; }

IsTable
Returns true if the property is an instance of SimPropertyTable.

Declaration Syntax
public bool IsTable { get; }

IsValid
Returns true if the property is valid.

Declaration Syntax
public bool IsValid { get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 15
Ansys.AAP.PublicAPIs.SimData Namespace

Name
Returns the name of the property.

Declaration Syntax
public string Name { get; }

Options
Gets or sets the options list for the select control.

Declaration Syntax
public List<string> Options { set;get; }

ParentCaption
Returns the parent caption of the property.

Declaration Syntax
public string ParentCaption { get; }

ParentPropertyGroup
Returns the parent PropertyGroup.

Declaration Syntax
public ISimPropertyGroup ParentPropertyGroup { get; }

QuantityName
Returns the quantity name for this property.

Declaration Syntax
public string QuantityName { get; }

ReadOnly
Gets or sets the editable state of the property.

Declaration Syntax
public bool ReadOnly { set;get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
16 of ANSYS, Inc. and its subsidiaries and affiliates.
ISimProperty

UniqueName
Get or sets a unique name for this property.

Declaration Syntax
public string UniqueName { set;get; }

UnitString
Gets the unit string for this property.

Declaration Syntax
public string UnitString { get; }

Value
Gets or sets the value for this property.

Declaration Syntax
public object Value { set;get; }

ValueString
Gets or sets the value string for this property.

Declaration Syntax
public string ValueString { set;get; }

Visible
Gets or sets the visibility state of the property.

Declaration Syntax
public bool Visible { set;get; }

GetAttributeValue(string)
Gets an attribute value by its name.

Declaration Syntax
public object GetAttributeValue(string attrName)

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 17
Ansys.AAP.PublicAPIs.SimData Namespace

Parameters
attrName(string)
The name of the attribute.

GetAttributeValueAsString(string)
Gets an attribute value by its name.

Declaration Syntax
public string GetAttributeValueAsString(string attrName)

Parameters
attrName(string)
The name of the attribute.

ISimPropertyGroup
ISimPropertyGroup Interface

Declaration Syntax
public interface ISimPropertyGroup

Table 11: Members

Property Display Returns the display type of the property.

Display
Returns the display type of the property.

Declaration Syntax
public string Display { get; }

ISimPropertyTable
ISimPropertyTable Interface

Declaration Syntax
public interface ISimPropertyTable

Table 12: Members

Property ActiveRow Gets or sets the active row.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
18 of ANSYS, Inc. and its subsidiaries and affiliates.
ISimPropertyTable

Property RowCount Returns the row count.


Property UpdateStateFreq Gets or sets the frequency of update state.
Property ValidState Gets or sets the valid state.
Method AddRow() Add a new row.
Method DeleteRow(int) Deletes a row by its index.
Method SaveActiveRow() Saves the data associated with the active row.

ActiveRow
Gets or sets the active row.

Declaration Syntax
public int ActiveRow { set;get; }

RowCount
Returns the row count.

Declaration Syntax
public int RowCount { get; }

UpdateStateFreq
Gets or sets the frequency of update state.

Declaration Syntax
public UpdateStateFreqEnum UpdateStateFreq { set;get; }

ValidState
Gets or sets the valid state.

Declaration Syntax
public ValidStateEnum ValidState { set;get; }

AddRow()
Add a new row.

Declaration Syntax
public void AddRow()

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 19
Ansys.AAP.PublicAPIs.SimData Namespace

DeleteRow(int)
Deletes a row by its index.

Declaration Syntax
public void DeleteRow(int index)

Parameters
index(int)
Index of the row (0 for first row).

SaveActiveRow()
Saves the data associated with the active row.

Declaration Syntax
public void SaveActiveRow()

ISimResult
IResultObject Interface

Declaration Syntax
public interface ISimResult

Table 13: Members

Property CalculateTimeHistory Flag to determine if the time history is to be computed


(false by default).
Property Location Returns the location.
Property Suppressed Gets or sets the suppression state of this result in the
associated analysis.
Property Type Returns the type.
Property Unit Returns the unit.

CalculateTimeHistory
Flag to determine if the time history is to be computed (false by default).

Declaration Syntax
public bool CalculateTimeHistory { set;get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
20 of ANSYS, Inc. and its subsidiaries and affiliates.
ISimSolver

Location
Returns the location.

Declaration Syntax
public LocationType Location { get; }

Suppressed
Gets or sets the suppression state of this result in the associated analysis.

Declaration Syntax
public bool Suppressed { set;get; }

Type
Returns the type.

Declaration Syntax
public ResultType Type { get; }

Unit
Returns the unit.

Declaration Syntax
public string Unit { get; }

ISimSolver
ISimSolver Interface

Declaration Syntax
public interface ISimSolver

Table 14: Members

Property AnalysisType Returns the analysis type string.


Property PhysicsType Returns the physics type string.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 21
Ansys.AAP.PublicAPIs.SimData Namespace

AnalysisType
Returns the analysis type string.

Declaration Syntax
public string AnalysisType { get; }

PhysicsType
Returns the physics type string.

Declaration Syntax
public string PhysicsType { get; }

LocationTypeEnum
Enumeration to specify result location types

Declaration Syntax
public enum LocationTypeEnum

Table 15: Members

Member AAP_Element Enum value of LocationType Element.


Member AAP_ElemNode Enum value of LocationType ElemNode.
Member AAP_Node Enum value of LocationType Node.

ResultTypeEnum
Enumeration to specify result value types

Declaration Syntax
public enum ResultTypeEnum

Table 16: Members

Member AAP_Scalar Enum value of ResultType Scalar.


Member AAP_Tensor Enum value of ResultType Tensor.
Member AAP_Vector Enum value of ResultType Vector.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
22 of ANSYS, Inc. and its subsidiaries and affiliates.
ValidStateEnum

UpdateStateFreqEnum
Enumeration to specify update state frequency types

Declaration Syntax
public enum UpdateStateFreqEnum

Table 17: Members

Member UpdateEachTime The valid state will be computed each time.


Member UpdateOnApply The valid state will be computed only when values
change.

ValidStateEnum
Enumeration to specify valid states

Declaration Syntax
public enum ValidStateEnum

Table 18: Members

Member StateInvalid The property is not valid.


Member StateUnknown The valid state is unknown.
Member StateValid The property is valid.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 23
Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
24 of ANSYS, Inc. and its subsidiaries and affiliates.
Ansys.AAP.PublicAPIs.Mesh Namespace
Declaration Syntax
namespace Ansys.AAP.PublicAPIs.Mesh

Table 19: Members

Element- Enumeration to specify Element Type Values


TypeEnum
IElement IElement Interface
IMeshData IMeshData Interface
IMeshRegion IMeshRegion Interface
INode INode Interface

ElementTypeEnum
Enumeration to specify Element Type Values

Declaration Syntax
public enum ElementTypeEnum

Table 20: Members

Member kBeam3 Three Node Beam.


Member kBeam4 Four Node Beam.
Member kHex20 Twenty Node Hexahedron.
Member kHex8 Eight Node Hexahedron.
Member kLine2 Two Node Line.
Member kLine3 Three Node Line.
Member kPoint0 Point.
Member kPyram- Thirteen Node Pyramid.
id13
Member kPyramid5 Five Node Pyramid.
Member kQuad4 Four Node Quadrilateral.
Member kQuad8 Eight Node Quadrilateral.
Member kTet10 Ten Node Tetrahedron.
Member kTet4 Four Node Tetrahedron.
Member kTri3 Three Node Triangle.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 25
Ansys.AAP.PublicAPIs.Mesh Namespace

Member kTri6 Six Node Triangle.


Member kUn- Unknown.
known
Member kWedge15 Fifteen Node Wedge.
Member kWedge6 Six Node Wedge.

IElement
IElement Interface

Declaration Syntax
public interface IElement

Table 21: Members

Property Area Returns the area of this element.


Property Centroid Returns the centroid of this element.
Property CornerNodeIds Returns a list of the corner node IDs for this element.
Property Id Returns the ID for this element.
Property NodeIds Returns a list of the node IDs for this element.
Property Type Returns the ElementTypeEnum for this element.
Property Volume Returns the volume of this element.

Area
Returns the area of this element.

Declaration Syntax
public double Area { get; }

Centroid
Returns the centroid of this element.

Declaration Syntax
public double[] Centroid { get; }

CornerNodeIds
Returns a list of the corner node IDs for this element.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
26 of ANSYS, Inc. and its subsidiaries and affiliates.
IMeshData

Declaration Syntax
public IList<int> CornerNodeIds { get; }

Id
Returns the ID for this element.

Declaration Syntax
public int Id { get; }

NodeIds
Returns a list of the node IDs for this element.

Declaration Syntax
public IList<int> NodeIds { get; }

Type
Returns the ElementTypeEnum for this element.

Declaration Syntax
public ElementTypeEnum Type { get; }

Volume
Returns the volume of this element.

Declaration Syntax
public double Volume { get; }

IMeshData
IMeshData Interface

Declaration Syntax
public interface IMeshData

Table 22: Members

Property ElementCount Returns the number of elements that this


MeshData object contains.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 27
Ansys.AAP.PublicAPIs.Mesh Namespace

Property ElementIds Returns a list of the elements IDs that this


MeshData object contains.
Property NodeCount Returns the number of nodes that this Mesh-
Data object contains.
Property NodeIds Returns a list of the node IDs that this Mesh-
Data object contains.
Property Unit Returns the units for this MeshData object.
Method ElementById(int) Returns the IElement object for the specified
element ID.
Method ElementIdsFromNodeIds(IEnumer- Returns a list of element IDs associated with a
able<int>) list of node IDs.
Method MeshRegionById(int) Returns the IMeshRegion object for the spe-
cified reference ID.
Method NodeById(int) Returns the INode object for the specified node
ID.
Method NodeIdsFromElementIds(IEnumer- Returns a list of node IDs associated with a list
able<int>) of element IDs.

ElementCount
Returns the number of elements that this MeshData object contains.

Declaration Syntax
public int ElementCount { get; }

ElementIds
Returns a list of the elements IDs that this MeshData object contains.

Declaration Syntax
public IList<int> ElementIds { get; }

NodeCount
Returns the number of nodes that this MeshData object contains.

Declaration Syntax
public int NodeCount { get; }

NodeIds
Returns a list of the node IDs that this MeshData object contains.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
28 of ANSYS, Inc. and its subsidiaries and affiliates.
IMeshData

Declaration Syntax
public IList<int> NodeIds { get; }

Unit
Returns the units for this MeshData object.

Declaration Syntax
public string Unit { get; }

ElementById(int)
Returns the IElement object for the specified element ID.

Declaration Syntax
public IElement ElementById(int elementId)

Parameters
elementId(int)
An element ID.

ElementIdsFromNodeIds(IEnumerable<int>)
Returns a list of element IDs associated with a list of node IDs.

Declaration Syntax
public IList<int> ElementIdsFromNodeIds(IEnumerable<int> nodes)

Parameters
nodes(IEnumerable<int>)
A list of node IDs.

MeshRegionById(int)
Returns the IMeshRegion object for the specified reference ID.

Declaration Syntax
public IMeshRegion MeshRegionById(int refId)

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 29
Ansys.AAP.PublicAPIs.Mesh Namespace

Parameters
refId(int)
Reference ID.

NodeById(int)
Returns the INode object for the specified node ID.

Declaration Syntax
public INode NodeById(int nodeId)

Parameters
nodeId(int)
A node ID.

NodeIdsFromElementIds(IEnumerable<int>)
Returns a list of node IDs associated with a list of element IDs.

Declaration Syntax
public IList<int> NodeIdsFromElementIds(IEnumerable<int> elements)

Parameters
elements(IEnumerable<int>)
A list of element IDs.

IMeshRegion
IMeshRegion Interface

Declaration Syntax
public interface IMeshRegion

Table 23: Members

Property ElementCount Returns the number of elements that this MeshRegion object
contains.
Property ElementIds Returns a list of the element IDs that this MeshRegion object
contains.
Property NodeCount Returns the number of nodes that this MeshRegion object con-
tains.
Property NodeIds Returns a list of the node IDs that this MeshRegion object con-
tains.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
30 of ANSYS, Inc. and its subsidiaries and affiliates.
INode

ElementCount
Returns the number of elements that this MeshRegion object contains.

Declaration Syntax
public int ElementCount { get; }

ElementIds
Returns a list of the element IDs that this MeshRegion object contains.

Declaration Syntax
public IList<int> ElementIds { get; }

NodeCount
Returns the number of nodes that this MeshRegion object contains.

Declaration Syntax
public int NodeCount { get; }

NodeIds
Returns a list of the node IDs that this MeshRegion object contains.

Declaration Syntax
public IList<int> NodeIds { get; }

INode
INode Interface

Declaration Syntax
public interface INode

Table 24: Members

Property ConnectedElementIds Returns a list of the element IDs that share this node.
Property Id Returns the ID of this node.
Property X Returns the global X coordinate of this node.
Property Y Returns the global Y coordinate of this node.
Property Z Returns the global Z coordinate of this node.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 31
Ansys.AAP.PublicAPIs.Mesh Namespace

ConnectedElementIds
Returns a list of the element IDs that share this node.

Declaration Syntax
public IList<int> ConnectedElementIds { get; }

Id
Returns the ID of this node.

Declaration Syntax
public int Id { get; }

X
Returns the global X coordinate of this node.

Declaration Syntax
public double X { get; }

Y
Returns the global Y coordinate of this node.

Declaration Syntax
public double Y { get; }

Z
Returns the global Z coordinate of this node.

Declaration Syntax
public double Z { get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
32 of ANSYS, Inc. and its subsidiaries and affiliates.
Ansys.AAP.PublicAPIs Namespace
Declaration Syntax
namespace Ansys.AAP.PublicAPIs

Table 25: Members

GeoBodyTypeEnum Enumeration to specify Body Type Values


GeoCellTypeEnum Enumeration to specify Cell Type Values
GeoCurveTypeEnum Enumeration to specify Curve Type Values
GeoSurfaceTypeEnum Enumeration to specify Surface Type Values
IDataModel IDataModel Interface
ILog ILog Interface

GeoBodyTypeEnum
Enumeration to specify Body Type Values

Declaration Syntax
public enum GeoBodyTypeEnum

Table 26: Members

Member GeoBodySheet Sheet.


Member GeoBodySolid Solid.
Member GeoBodyUnknown Unknown type.
Member GeoBodyWire Wire.

GeoCellTypeEnum
Enumeration to specify Cell Type Values

Declaration Syntax
public enum GeoCellTypeEnum

Table 27: Members

Member GeoBody Volume.


Member GeoEdge Edge.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 33
Ansys.AAP.PublicAPIs Namespace

Member GeoFace Face.


Member GeoUnknown Unknown type.
Member GeoVertex Vertex.

GeoCurveTypeEnum
Enumeration to specify Curve Type Values

Declaration Syntax
public enum GeoCurveTypeEnum

Table 28: Members

Member GeoCurveBSpline BSpline.


Member GeoCurveCircle Circle.
Member GeoCurveCircularArc Circular Arc.
Member GeoCurveEllipseFull Full Ellipse.
Member GeoCurveEllipticalArc Elliptical Arc.
Member GeoCurveFaceted Faceted Curve.
Member GeoCurveLine Line.
Member GeoCurveLineSegment Line Segment.
Member GeoCurveNoGeometry No Geometry.
Member GeoCurveUnknown Unknown type.

GeoSurfaceTypeEnum
Enumeration to specify Surface Type Values

Declaration Syntax
public enum GeoSurfaceTypeEnum

Table 29: Members

Member GeoSurfaceBSpline BSpline.


Member GeoSurfaceCone Cone.
Member GeoSurfaceCylinder Cylinder.
Member GeoSurfaceEllipticalCone Elliptical Cone.
Member GeoSurfaceEllipticalCylinder Elliptical Cylinder.
Member GeoSurfaceFaceted Faceted.
Member GeoSurfaceNoGeometry No Geometry.
Member GeoSurfacePlane Plane.
Member GeoSurfaceSphere Sphere.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
34 of ANSYS, Inc. and its subsidiaries and affiliates.
IDataModel

Member GeoSurfaceTorus Torus.


Member GeoSurfaceUnknown Unknown type.

IDataModel
IDataModel Interface

Declaration Syntax
public interface IDataModel

Table 30: Members

Property AnalysisList Returns a list of available IAnalysis


objects.
Property AnalysisNames Returns the list of available analysis
names.
Property GeoData Returns an IGeoData object contain-
ing all geometry assemblies.
Property MeshDataNames Returns the list of names for all avail-
able meshes on the model.
Method AnalysisById(int) Returns an IAnalysis object by its Id.
Method AnalysisByName(string) Returns an IAnalysis object by its
name.
Method CurrentConsistentUnitFromQuantity- Returns the current consistent unit
Name(string) from a quantity name.
Method CurrentUnitFromQuantityName(string) Returns the current unit from a
quantity name.
Method MeshDataByName(string) Returns a meshdata object by its
name.

AnalysisList
Returns a list of available IAnalysis objects.

Declaration Syntax
public IList<IAnalysis> AnalysisList { get; }

AnalysisNames
Returns the list of available analysis names.

Declaration Syntax
public IList<string> AnalysisNames { get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 35
Ansys.AAP.PublicAPIs Namespace

GeoData
Returns an IGeoData object containing all geometry assemblies.

Declaration Syntax
public IGeoData GeoData { get; }

MeshDataNames
Returns the list of names for all available meshes on the model.

Declaration Syntax
public IList<string> MeshDataNames { get; }

AnalysisById(int)
Returns an IAnalysis object by its Id.

Declaration Syntax
public IAnalysis AnalysisById(int id)

Parameters
id(int)
The Id of the analysis.

AnalysisByName(string)
Returns an IAnalysis object by its name.

Declaration Syntax
public IAnalysis AnalysisByName(string name)

Parameters
name(string)
The name of the analysis.

CurrentConsistentUnitFromQuantityName(string)
Returns the current consistent unit from a quantity name.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
36 of ANSYS, Inc. and its subsidiaries and affiliates.
ILog

Declaration Syntax
public string CurrentConsistentUnitFromQuantityName(string qname)

Parameters
qname(string)
The quantity name to query.

CurrentUnitFromQuantityName(string)
Returns the current unit from a quantity name.

Declaration Syntax
public string CurrentUnitFromQuantityName(string qname)

Parameters
qname(string)
The quantity name to query.

MeshDataByName(string)
Returns a meshdata object by its name.

Declaration Syntax
public IMeshData MeshDataByName(string name)

Parameters
name(string)
The name of the mesh.

ILog
ILog Interface

Declaration Syntax
public interface ILog

Table 31: Members

Property LogFilename Returns the name of the log file.


Method ViewLog() Displays the log file.
Method WriteError(string) Adds an error string entry into the log.
Method WriteMessage(string) Adds a message string entry into the log.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 37
Ansys.AAP.PublicAPIs Namespace

LogFilename
Returns the name of the log file.

Declaration Syntax
public string LogFilename { get; }

ViewLog()
Displays the log file.

Declaration Syntax
public void ViewLog()

WriteError(string)
Adds an error string entry into the log.

Declaration Syntax
public void WriteError(string message)

Parameters
message(string)
The error to be added.

WriteMessage(string)
Adds a message string entry into the log.

Declaration Syntax
public void WriteMessage(string message)

Parameters
message(string)
The message to be added.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
38 of ANSYS, Inc. and its subsidiaries and affiliates.
Ansys.AAP.PublicAPIs.Geometry Namespace
Declaration Syntax
namespace Ansys.AAP.PublicAPIs.Geometry

Table 32: Members

IGeoAssembly Geometry Assembly Interface


IGeoBody Geometry Body Interface
IGeoData IGeoData Interface
IGeoEdge Geometry Edge Interface
IGeoEntity Geometry Entity Interface
IGeoFace Geometry Face Interface
IGeoLoop Geometry Loop Interface
IGeoPart Geometry Part Interface
IGeoShell Geometry Shell Interface
IGeoTessellation Geometry Tessellation Interface
IGeoVertex Geometry Vertex Interface

IGeoAssembly
Geometry Assembly Interface

Declaration Syntax
public interface IGeoAssembly

Table 33: Members

Property Dimension Returns 2 for 2D geometry and 3 for 3D geometry.


Property Name Returns the name of this assembly.
Property Parts Returns a list of the IGeoPart objects for this assembly.
Property Unit Returns the unit string for this assembly.

Dimension
Returns 2 for 2D geometry and 3 for 3D geometry.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 39
Ansys.AAP.PublicAPIs.Geometry Namespace

Declaration Syntax
public int Dimension { get; }

Name
Returns the name of this assembly.

Declaration Syntax
public string Name { get; }

Parts
Returns a list of the IGeoPart objects for this assembly.

Declaration Syntax
public IList<IGeoPart> Parts { get; }

Unit
Returns the unit string for this assembly.

Declaration Syntax
public string Unit { get; }

IGeoBody
Geometry Body Interface

Declaration Syntax
public interface IGeoBody

Table 34: Members

Property Area Returns the area of the body.


Property BodyType Returns the body type (wire, sheet or solid).
Property CrossSection Returns the beam cross section associated with this
body.
Property CrossSectionOffset Gets or sets the beam cross section offset for this body.
Property CrossSectionOffsetType Gets or sets the beam cross section offset type for this
body.
Property Edges Returns a list of the IGeoEdge objects for this body.
Property Faces Returns a list of the IGeoFace objects for this body.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
40 of ANSYS, Inc. and its subsidiaries and affiliates.
IGeoBody

Property Length Returns the length of the body.


Property Material Returns the Material object associated with this body.
Property Name Returns the name of this body.
Property Shells Returns a list of the IGeoShell objects for this body.
Property Suppressed Returns true if the body is suppressed.
Property Thickness Returns the thickness of the body.
Property Vertices Returns a list of the IGeoVertex objects for this body.
Property Volume Returns the volume of the body.

Area
Returns the area of the body.

Declaration Syntax
public double Area { get; }

BodyType
Returns the body type (wire, sheet or solid).

Declaration Syntax
public GeoBodyTypeEnum BodyType { get; }

CrossSection
Returns the beam cross section associated with this body.

Declaration Syntax
public object CrossSection { set;get; }

CrossSectionOffset
Gets or sets the beam cross section offset for this body.

Declaration Syntax
public IEnumerable<double> CrossSectionOffset { set;get; }

CrossSectionOffsetType
Gets or sets the beam cross section offset type for this body.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 41
Ansys.AAP.PublicAPIs.Geometry Namespace

Declaration Syntax
public string CrossSectionOffsetType { set;get; }

Edges
Returns a list of the IGeoEdge objects for this body.

Declaration Syntax
public IList<IGeoEdge> Edges { get; }

Faces
Returns a list of the IGeoFace objects for this body.

Declaration Syntax
public IList<IGeoFace> Faces { get; }

Length
Returns the length of the body.

Declaration Syntax
public double Length { get; }

Material
Returns the Material object associated with this body.

Declaration Syntax
public object Material { get; }

Name
Returns the name of this body.

Declaration Syntax
public string Name { get; }

Shells
Returns a list of the IGeoShell objects for this body.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
42 of ANSYS, Inc. and its subsidiaries and affiliates.
IGeoData

Declaration Syntax
public IList<IGeoShell> Shells { get; }

Suppressed
Returns true if the body is suppressed.

Declaration Syntax
public bool Suppressed { get; }

Thickness
Returns the thickness of the body.

Declaration Syntax
public double Thickness { set;get; }

Vertices
Returns a list of the IGeoVertex objects for this body.

Declaration Syntax
public IList<IGeoVertex> Vertices { get; }

Volume
Returns the volume of the body.

Declaration Syntax
public double Volume { get; }

IGeoData
IGeoData Interface

Declaration Syntax
public interface IGeoData

Table 35: Members

Property Assemblies Returns the list of available IGeoAssembly objects.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 43
Ansys.AAP.PublicAPIs.Geometry Namespace

Method GeoEntityBy- Returns a IGeoEntity object by its reference ID.


Id(int)

Assemblies
Returns the list of available IGeoAssembly objects.

Declaration Syntax
public IList<IGeoAssembly> Assemblies { get; }

GeoEntityById(int)
Returns a IGeoEntity object by its reference ID.

Declaration Syntax
public IGeoEntity GeoEntityById(int refId)

Parameters
refId(int)
The reference ID of the desired IGeoEntity object.

IGeoEdge
Geometry Edge Interface

Declaration Syntax
public interface IGeoEdge

Table 36: Members

Property CrossSectionOrientation Returns a CoordinateSystem object that defines


the edge cross section orientation.
Property CurveType Returns the eGeoCurveType of this edge.
Property EndVertex Returns the ending IGeoVertex object for this
edge.
Property Extents Returns the param extents of this edge as a
double array [min, max].
Property Faces Returns a list of the IGeoFace objects for this
edge.
Property IsParamReversed Returns ParamReversed state for this edge (true
or false).
Property Length Returns the length of this edge.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
44 of ANSYS, Inc. and its subsidiaries and affiliates.
IGeoEdge

Property StartVertex Returns the starting IGeoVertex object for this


edge.
Property Vertices Returns a list of the IGeoVertex objects for this
edge.
Method ParamAtPoint(double[]) Returns the param for the given point on this
edge (point[3] = {x, y, z}).
Method PointAtParam(double) Returns the point for the given param on this
edge.
Method PointsAtParams(double[]) Returns an array of point coordinates for the
given set of params on this edge.
Method TangentAtParam(double) Returns the tangent vector for the given param
on this edge.
Method TangentsAtParams(double[]) Retuns an array of tangent vectors for the giv-
en set of params on this edge.

CrossSectionOrientation
Returns a CoordinateSystem object that defines the edge cross section orientation.

Declaration Syntax
public CoordinateSystem CrossSectionOrientation { set;get; }

CurveType
Returns the eGeoCurveType of this edge.

Declaration Syntax
public GeoCurveTypeEnum CurveType { get; }

EndVertex
Returns the ending IGeoVertex object for this edge.

Declaration Syntax
public IGeoVertex EndVertex { get; }

Extents
Returns the param extents of this edge as a double array [min, max].

Declaration Syntax
public double[] Extents { get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 45
Ansys.AAP.PublicAPIs.Geometry Namespace

Faces
Returns a list of the IGeoFace objects for this edge.

Declaration Syntax
public IList<IGeoFace> Faces { get; }

IsParamReversed
Returns ParamReversed state for this edge (true or false).

Declaration Syntax
public bool IsParamReversed { get; }

Length
Returns the length of this edge.

Declaration Syntax
public double Length { get; }

StartVertex
Returns the starting IGeoVertex object for this edge.

Declaration Syntax
public IGeoVertex StartVertex { get; }

Vertices
Returns a list of the IGeoVertex objects for this edge.

Declaration Syntax
public IList<IGeoVertex> Vertices { get; }

ParamAtPoint(double[])
Returns the param for the given point on this edge (point[3] = {x, y, z}).

Declaration Syntax
public double ParamAtPoint(double[] point)

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
46 of ANSYS, Inc. and its subsidiaries and affiliates.
IGeoEdge

Parameters
point(double[])
point[3] = {x, y, z}.

PointAtParam(double)
Returns the point for the given param on this edge.

Declaration Syntax
public double[] PointAtParam(double param)

Parameters
param(double)
The edge param value.

PointsAtParams(double[])
Returns an array of point coordinates for the given set of params on this edge.

Declaration Syntax
public double[] PointsAtParams(double[] param)

Parameters
param(double[])
An array of params for which points are to be returned (ordered p1,p2,...,pn).

TangentAtParam(double)
Returns the tangent vector for the given param on this edge.

Declaration Syntax
public double[] TangentAtParam(double param)

Parameters
param(double)
The edge param value.

TangentsAtParams(double[])
Returns an array of tangent vectors for the given set of params on this edge.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 47
Ansys.AAP.PublicAPIs.Geometry Namespace

Declaration Syntax
public double[] TangentsAtParams(double[] param)

Parameters
param(double[])
An array of params for which tangents are to be returned (ordered p1,p2,...,pn).

IGeoEntity
Geometry Entity Interface

Declaration Syntax
public interface IGeoEntity

Table 37: Members

Property Id Returns the reference ID of this entity.


Property Type Returns the GeoCellTypeEnum of this entity.

Id
Returns the reference ID of this entity.

Declaration Syntax
public int Id { get; }

Type
Returns the GeoCellTypeEnum of this entity.

Declaration Syntax
public GeoCellTypeEnum Type { get; }

IGeoFace
Geometry Face Interface

Declaration Syntax
public interface IGeoFace

Table 38: Members

Property Area Returns the area of this face.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
48 of ANSYS, Inc. and its subsidiaries and affiliates.
IGeoFace

Property Body Returns the IGeoBody object for this face.


Property Edges Returns a list of the edge IGeoEdge for this
face.
Property Loops Returns a list of the IGeoLoop objects for this
face.
Property Shell Returns the IGeoShell object for this face.
Property SurfaceType Returns the GeoSurfaceTypeEnum of this face.
Property Vertices Returns a list of the IGeoVertex objects for this
face.
Method NormalAtParam(double, double) Returns the normal vector for the given param
values on this face.
Method NormalsAtParams(double[]) Returns an array of normal vectors for the giv-
en set of params on this face.
Method ParamAtPoint(double[]) Returns the param values for the given point
on this face.
Method PointAtParam(double, double) Returns the point for the given param values
on this face.
Method PointsAtParams(double[]) Returns an array of point coordinates for the
given set of params on this face.

Area
Returns the area of this face.

Declaration Syntax
public double Area { get; }

Body
Returns the IGeoBody object for this face.

Declaration Syntax
public IGeoBody Body { get; }

Edges
Returns a list of the edge IGeoEdge for this face.

Declaration Syntax
public IList<IGeoEdge> Edges { get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 49
Ansys.AAP.PublicAPIs.Geometry Namespace

Loops
Returns a list of the IGeoLoop objects for this face.

Declaration Syntax
public IList<IGeoLoop> Loops { get; }

Shell
Returns the IGeoShell object for this face.

Declaration Syntax
public IGeoShell Shell { get; }

SurfaceType
Returns the GeoSurfaceTypeEnum of this face.

Declaration Syntax
public GeoSurfaceTypeEnum SurfaceType { get; }

Vertices
Returns a list of the IGeoVertex objects for this face.

Declaration Syntax
public IList<IGeoVertex> Vertices { get; }

NormalAtParam(double, double)
Returns the normal vector for the given param values on this face.

Declaration Syntax
public double[] NormalAtParam(double u, double v)

Parameters
u(double)
The -u- param component value.

v(double)
The -v- param component value.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
50 of ANSYS, Inc. and its subsidiaries and affiliates.
IGeoFace

NormalsAtParams(double[])
Returns an array of normal vectors for the given set of params on this face.

Declaration Syntax
public double[] NormalsAtParams(double[] param)

Parameters
param(double[])
An array of params for which normals are to be returned (ordered p1u,p1v,p2u,p2v,...,pnu,pnv).

ParamAtPoint(double[])
Returns the param values for the given point on this face.

Declaration Syntax
public double[] ParamAtPoint(double[] point)

Parameters
point(double[])
The coordinates (x,y,z) of the point.

PointAtParam(double, double)
Returns the point for the given param values on this face.

Declaration Syntax
public double[] PointAtParam(double u, double v)

Parameters
u(double)
The -u- param component value.

v(double)
The -v- param component value.

PointsAtParams(double[])
Returns an array of point coordinates for the given set of params on this face.

Declaration Syntax
public double[] PointsAtParams(double[] param)

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 51
Ansys.AAP.PublicAPIs.Geometry Namespace

Parameters
param(double[])
An array of params for which points are to be returned (ordered p1u,p1v,p2u,p2v,...,pnu,pnv).

IGeoLoop
Geometry Loop Interface

Declaration Syntax
public interface IGeoLoop

Table 39: Members

Property Edges Returns a list of the IGeoEdge objects for this loop.
Property Face Returns the IGeoFace object for this loop.

Edges
Returns a list of the IGeoEdge objects for this loop.

Declaration Syntax
public IList<IGeoEdge> Edges { get; }

Face
Returns the IGeoFace object for this loop.

Declaration Syntax
public IGeoFace Face { get; }

IGeoPart
Geometry Part Interface

Declaration Syntax
public interface IGeoPart

Table 40: Members

Property Bodies Returns a list of the IGeoBody objects for this part.
Property Name Returns the name of this part.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
52 of ANSYS, Inc. and its subsidiaries and affiliates.
IGeoTessellation

Bodies
Returns a list of the IGeoBody objects for this part.

Declaration Syntax
public IList<IGeoBody> Bodies { get; }

Name
Returns the name of this part.

Declaration Syntax
public string Name { get; }

IGeoShell
Geometry Shell Interface

Declaration Syntax
public interface IGeoShell

Table 41: Members

Property Faces Returns a list of the IGeoFace objects for this shell.

Faces
Returns a list of the IGeoFace objects for this shell.

Declaration Syntax
public IList<IGeoFace> Faces { get; }

IGeoTessellation
Geometry Tessellation Interface

Declaration Syntax
public interface IGeoTessellation

Table 42: Members

Property FacetCount Returns the number of facets.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 53
Ansys.AAP.PublicAPIs.Geometry Namespace

Property Indices Returns an array of indices. (Ordered n1,i1_1,i1_2,...,i1_n1,


n2,i2_1,i2_2,...i2_n2, ...).
Property Normals Returns an array of normal vectors. (Ordered
x1,y1,z1,x2,y2,z2,...,xn,yn,zn).
Property Points Returns an array of point coordinates. (Ordered
x1,y1,z1,x2,y2,z2,...,xn,yn,zn).

FacetCount
Returns the number of facets.

Declaration Syntax
public int FacetCount { get; }

Indices
Returns an array of indices. (Ordered n1,i1_1,i1_2,...,i1_n1, n2,i2_1,i2_2,...i2_n2, ...).

Declaration Syntax
public int[] Indices { get; }

Normals
Returns an array of normal vectors. (Ordered x1,y1,z1,x2,y2,z2,...,xn,yn,zn).

Declaration Syntax
public double[] Normals { get; }

Points
Returns an array of point coordinates. (Ordered x1,y1,z1,x2,y2,z2,...,xn,yn,zn).

Declaration Syntax
public double[] Points { get; }

IGeoVertex
Geometry Vertex Interface

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
54 of ANSYS, Inc. and its subsidiaries and affiliates.
IGeoVertex

Declaration Syntax
public interface IGeoVertex

Table 43: Members

Property Bodies Returns a list of the IGeoBody objects for this vertex.
Property Edges Returns a list of the IGeoEdge objects for this vertex.
Property Faces Returns a list of the IGeoFace objects for this vertex.
Property X Returns the X point coordinate of this vertex.
Property Y Returns the Y point coordinate of this vertex.
Property Z Returns the Z point coordinate of this vertex.

Bodies
Returns a list of the IGeoBody objects for this vertex.

Declaration Syntax
public IList<IGeoBody> Bodies { get; }

Edges
Returns a list of the IGeoEdge objects for this vertex.

Declaration Syntax
public IList<IGeoEdge> Edges { get; }

Faces
Returns a list of the IGeoFace objects for this vertex.

Declaration Syntax
public IList<IGeoFace> Faces { get; }

X
Returns the X point coordinate of this vertex.

Declaration Syntax
public double X { get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 55
Ansys.AAP.PublicAPIs.Geometry Namespace

Y
Returns the Y point coordinate of this vertex.

Declaration Syntax
public double Y { get; }

Z
Returns the Z point coordinate of this vertex.

Declaration Syntax
public double Z { get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
56 of ANSYS, Inc. and its subsidiaries and affiliates.
Ansys.AAP.PublicAPIs.Results Namespace
Declaration Syntax
namespace Ansys.AAP.PublicAPIs.Results

Table 44: Members

IResult IResult Interface


IResultRead- IResultReader Interface
er

IResult
IResult Interface

Declaration Syntax
public interface IResult

Table 45: Members

Property Components Returns a list of component names for this


result.
Property Name Returns the name of this result.
Property QuantityNames Returns a list of quantity names in component
name order.
Property Units Returns a list of units for each component.
Method ElementValue(int, string) Returns the requested element result value set.
Method ElementValues(IEnumerable<int>, Returns the requested element result value
string) sets.
Method NodeValue(int, string) Returns the requested nodal result value set.
Method NodeValues(IEnumerable<int>, Returns the requested nodal result value sets.
string)

Components
Returns a list of component names for this result.

Declaration Syntax
public IList<string> Components { get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 57
Ansys.AAP.PublicAPIs.Results Namespace

Name
Returns the name of this result.

Declaration Syntax
public string Name { get; }

QuantityNames
Returns a list of quantity names in component name order.

Declaration Syntax
public IList<string> QuantityNames { get; }

Units
Returns a list of units for each component.

Declaration Syntax
public IList<string> Units { get; }

ElementValue(int, string)
Returns the requested element result value set.

Declaration Syntax
public double[] ElementValue(int entityId, string comps)

Parameters
entityId(int)
The element ID to query for the result.

comps(string)
The components of the result to be returned.

ElementValues(IEnumerable<int>, string)
Returns the requested element result value sets.

Declaration Syntax
public double[] ElementValues(IEnumerable<int> entityId, string comps)

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
58 of ANSYS, Inc. and its subsidiaries and affiliates.
IResultReader

Parameters
entityId(IEnumerable<int>)
An array of element IDs to query for the result.

comps(string)
The components of the result to be returned.

NodeValue(int, string)
Returns the requested nodal result value set.

Declaration Syntax
public double[] NodeValue(int entityId, string comps)

Parameters
entityId(int)
The node ID to query for the result.

comps(string)
The components of the result to be returned.

NodeValues(IEnumerable<int>, string)
Returns the requested nodal result value sets.

Declaration Syntax
public double[] NodeValues(IEnumerable<int> entityId, string comps)

Parameters
entityId(IEnumerable<int>)
An array of node IDs to query for the result.

comps(string)
The components of the result to be returned.

IResultReader
IResultReader Interface

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 59
Ansys.AAP.PublicAPIs.Results Namespace

Declaration Syntax
public interface IResultReader

Table 46: Members

Property CurrentResultSet Returns the current result set index.


Property CurrentTimeFreq Returns the current time / frequency value.
Property HasImaginaryResults Returns the imaginary results state.
Property ListTimeFreq Returns a list of all the time steps or frequencies.
Property ResultSetCount Returns the number of result sets.
Property ResultsName Returns a list of the result names.
Method Result(string) Returns the IResult object for the specified name.

CurrentResultSet
Returns the current result set index.

Declaration Syntax
public int CurrentResultSet { set;get; }

CurrentTimeFreq
Returns the current time / frequency value.

Declaration Syntax
public double CurrentTimeFreq { get; }

HasImaginaryResults
Returns the imaginary results state.

Declaration Syntax
public bool HasImaginaryResults { get; }

ListTimeFreq
Returns a list of all the time steps or frequencies.

Declaration Syntax
public IList<double> ListTimeFreq { get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
60 of ANSYS, Inc. and its subsidiaries and affiliates.
IResultReader

ResultSetCount
Returns the number of result sets.

Declaration Syntax
public int ResultSetCount { get; }

ResultsName
Returns a list of the result names.

Declaration Syntax
public IList<string> ResultsName { get; }

Result(string)
Returns the IResult object for the specified name.

Declaration Syntax
public IResult Result(string name)

Parameters
name(string)
A result name.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 61
Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
62 of ANSYS, Inc. and its subsidiaries and affiliates.
Ansys.AAP.PublicAPIs.Analysis Namespace
Declaration Syntax
namespace Ansys.AAP.PublicAPIs.Analysis

Table 47: Members

CoordinateSystem CoordinateSystem class


CoordinateSystemTypeEnum CoordinateSystemTypeEnum enumerator
IAnalysis IAnalysis Interface
IDataObject IDataObject Interface
IDataObjectCollection IDataObjectCollection Interface
IDataObjectContainer IDataObjectContainer Interface

CoordinateSystem
CoordinateSystem class

Declaration Syntax
public class CoordinateSystem

Table 48: Members

Construct- CoordinateSystem(CoordinateSys- Constructor.


or temTypeEnum)
Property CoordinateSystemType Gets or sets the coordinate system type.
Property Id Gets or sets the ID of the coordinate system.
Property Matrix Gets or sets the matrix definition of the coordin-
ate system.
Property Name Gets or sets the name of the coordinate system.
Property Origin Gets or sets the origin of the coordinate sys-
tem.
Property XAxis Gets or sets the X axis of the coordinate sys-
tem.
Property YAxis Gets or sets the Y axis of the coordinate sys-
tem.
Property ZAxis Gets or sets the Z axis of the coordinate sys-
tem.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 63
Ansys.AAP.PublicAPIs.Analysis Namespace

CoordinateSystem(CoordinateSystemTypeEnum)
Constructor.

Declaration Syntax
public CoordinateSystem(CoordinateSystemTypeEnum type)

Parameters
type(CoordinateSystemTypeEnum)
The CoordinateSystemTypeEnum type to construct.

CoordinateSystemType
Gets or sets the coordinate system type.

Declaration Syntax
public CoordinateSystemTypeEnum CoordinateSystemType { set;get; }

Id
Gets or sets the ID of the coordinate system.

Declaration Syntax
public int Id { set;get; }

Matrix
Gets or sets the matrix definition of the coordinate system.

Declaration Syntax
public IEnumerable<double> Matrix { set;get; }

Name
Gets or sets the name of the coordinate system.

Declaration Syntax
public string Name { set;get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
64 of ANSYS, Inc. and its subsidiaries and affiliates.
CoordinateSystemTypeEnum

Origin
Gets or sets the origin of the coordinate system.

Declaration Syntax
public IEnumerable<double> Origin { set;get; }

XAxis
Gets or sets the X axis of the coordinate system.

Declaration Syntax
public IEnumerable<double> XAxis { set;get; }

YAxis
Gets or sets the Y axis of the coordinate system.

Declaration Syntax
public IEnumerable<double> YAxis { set;get; }

ZAxis
Gets or sets the Z axis of the coordinate system.

Declaration Syntax
public IEnumerable<double> ZAxis { set;get; }

CoordinateSystemTypeEnum
CoordinateSystemTypeEnum enumerator

Declaration Syntax
public enum CoordinateSystemTypeEnum

Table 49: Members

Member Cartesian Cartesian coordinate system.


Member Cylindrical Cylindrical coordinate system.
Member Spherical Spherical coordinate system.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 65
Ansys.AAP.PublicAPIs.Analysis Namespace

IAnalysis
IAnalysis Interface

Declaration Syntax
public interface IAnalysis

Table 50: Members

Property AnalysisType Returns the analysis type string.


Property Components Returns all (named selections) components.
Property CoordinateSystems Returns all coordinate systems.
Property GeoData Returns the IGeoData object associated with
this analysis.
Property Id Returns the ID for this analysis.
Property LoadObjects Returns all ACT load objects associated with
this analysis.
Property MeshData Returns the IMeshData object associated with
this analysis.
Property Name Returns the name of this analysis.
Property PhysicsType Returns the physics type string.
Property PropertyNames Returns a list of the property names for this
analysis.
Property ResultObjects Returns all ACT result objects associated with
this analysis.
Property ResultsData Return the IResultReader object associated with
this analysis.
Property Solver Returns all ACT solver obects associated with
this analysis.
Property SolverName Returns the solver name for this analysis.
Property StepsEndTime Returns a list of steps end times.
Property WorkingDir Returns the working directory.
Method ComponentById(int) Returns a (named selection) component by its
ID.
Method CoordinateSystemById(int) Returns a CoordinateSystem object by its ID.
Method CreateLoadObject(string) Creates a new load object.
Method CreateResultObject(string) Creates a new ISimResult object.
Method CurrentConsistentUnitFromQuant- Returns the current consistent unit from a
ityName(string) quantity name.
Method GenerateMesh() Generates the mesh associated with this ana-
lysis.
Method PropertyValue(string) Returns the property value with the specified
name.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
66 of ANSYS, Inc. and its subsidiaries and affiliates.
IAnalysis

Method PropertyValue(string, object) Assigns the given value to the simulation


property that matches the specified name.
Method Solve(bool) Compute the solution for this analysis.
Method WriteInputFile(string) Writes the input file associated to this analysis.

AnalysisType
Returns the analysis type string.

Declaration Syntax
public string AnalysisType { get; }

Components
Returns all (named selections) components.

Declaration Syntax
public IEnumerable<SelectionInfo> Components { get; }

CoordinateSystems
Returns all coordinate systems.

Declaration Syntax
public IEnumerable<CoordinateSystem> CoordinateSystems { get; }

GeoData
Returns the IGeoData object associated with this analysis.

Declaration Syntax
public IGeoData GeoData { get; }

Id
Returns the ID for this analysis.

Declaration Syntax
public int Id { get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 67
Ansys.AAP.PublicAPIs.Analysis Namespace

LoadObjects
Returns all ACT load objects associated with this analysis.

Declaration Syntax
public IEnumerable<ISimLoad> LoadObjects { get; }

MeshData
Returns the IMeshData object associated with this analysis.

Declaration Syntax
public IMeshData MeshData { get; }

Name
Returns the name of this analysis.

Declaration Syntax
public string Name { get; }

PhysicsType
Returns the physics type string.

Declaration Syntax
public string PhysicsType { get; }

PropertyNames
Returns a list of the property names for this analysis.

Declaration Syntax
public IList<string> PropertyNames { get; }

ResultObjects
Returns all ACT result objects associated with this analysis.

Declaration Syntax
public IEnumerable<ISimResult> ResultObjects { get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
68 of ANSYS, Inc. and its subsidiaries and affiliates.
IAnalysis

ResultsData
Return the IResultReader object associated with this analysis.

Declaration Syntax
public IResultReader ResultsData { get; }

Solver
Returns all ACT solver obects associated with this analysis.

Declaration Syntax
public ISimSolver Solver { get; }

SolverName
Returns the solver name for this analysis.

Declaration Syntax
public string SolverName { get; }

StepsEndTime
Returns a list of steps end times.

Declaration Syntax
public IList<double> StepsEndTime { get; }

WorkingDir
Returns the working directory.

Declaration Syntax
public string WorkingDir { get; }

ComponentById(int)
Returns a (named selection) component by its ID.

Declaration Syntax
public SelectionInfo ComponentById(int id)

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 69
Ansys.AAP.PublicAPIs.Analysis Namespace

Parameters
id(int)
The ID of the desired component.

CoordinateSystemById(int)
Returns a CoordinateSystem object by its ID.

Declaration Syntax
public CoordinateSystem CoordinateSystemById(int id)

Parameters
id(int)
The ID of the desired coordinate system.

CreateLoadObject(string)
Creates a new load object.

Declaration Syntax
public ISimLoad CreateLoadObject(string loadName)

Parameters
loadName(string)
The name to be assigned to the new load.

CreateResultObject(string)
Creates a new ISimResult object.

Declaration Syntax
public ISimResult CreateResultObject(string resultName)

Parameters
resultName(string)
The name to be assigned to the new result.

CurrentConsistentUnitFromQuantityName(string)
Returns the current consistent unit from a quantity name.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
70 of ANSYS, Inc. and its subsidiaries and affiliates.
IAnalysis

Declaration Syntax
public string CurrentConsistentUnitFromQuantityName(string qname)

Parameters
qname(string)
The quantity name to query.

GenerateMesh()
Generates the mesh associated with this analysis.

Declaration Syntax
public void GenerateMesh()

PropertyValue(string)
Returns the property value with the specified name.

Declaration Syntax
public object PropertyValue(string name)

Parameters
name(string)
The name of the property to return.

PropertyValue(string, object)
Assigns the given value to the simulation property that matches the specified name.

Declaration Syntax
public void PropertyValue(string name, object value)

Parameters
name(string)
The simulation property name.

value(object)
The value to assign.

Solve(bool)
Compute the solution for this analysis.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 71
Ansys.AAP.PublicAPIs.Analysis Namespace

Declaration Syntax
public void Solve(bool wait)

Parameters
wait(bool)
Specifies to wait for the computation end.

WriteInputFile(string)
Writes the input file associated to this analysis.

Declaration Syntax
public void WriteInputFile(string filename)

Parameters
filename(string)
The name of the file to write.

IDataObject
IDataObject Interface

Declaration Syntax
public interface IDataObject

Table 51: Members

Property Id Returns the ID for this data object.


Property Name Returns the name for this data object.
Property PropertyNames Returns a list of the properties for this data
object.
Property Type Returns the type for this data object.
Method PropertyValue(string) Returns the property value with the specified
name.
Method PropertyValue(string, object) Assigns the given value to the simulation
property that matches the specified name.

Id
Returns the ID for this data object.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
72 of ANSYS, Inc. and its subsidiaries and affiliates.
IDataObject

Declaration Syntax
public int Id { get; }

Name
Returns the name for this data object.

Declaration Syntax
public string Name { get; }

PropertyNames
Returns a list of the properties for this data object.

Declaration Syntax
public IList<string> PropertyNames { get; }

Type
Returns the type for this data object.

Declaration Syntax
public string Type { get; }

PropertyValue(string)
Returns the property value with the specified name.

Declaration Syntax
public object PropertyValue(string name)

Parameters
name(string)
The name of the property to return.

PropertyValue(string, object)
Assigns the given value to the simulation property that matches the specified name.

Declaration Syntax
public void PropertyValue(string name, object value)

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 73
Ansys.AAP.PublicAPIs.Analysis Namespace

Parameters
name(string)
The simulation property name.

value(object)
The value to assign.

IDataObjectCollection
IDataObjectCollection Interface

Declaration Syntax
public interface IDataObjectCollection

Table 52: Members

Property Ids Returns a list of available IDs.


Property List Returns a list of available DataObjects.
Property Names Returns a list of available names.
Method GetById(int) Get a DataObject by its ID.
Method GetByName(string) Get a DataObject by its name.
Method GetEnumerator() Returns an enumerator for the current collection.
Method NamesByType(string) Returns a list of available DataObject names filtered by
type.

Ids
Returns a list of available IDs.

Declaration Syntax
public IList<int> Ids { get; }

List
Returns a list of available DataObjects.

Declaration Syntax
public IList<IDataObject> List { get; }

Names
Returns a list of available names.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
74 of ANSYS, Inc. and its subsidiaries and affiliates.
IDataObjectCollection

Declaration Syntax
public IList<string> Names { get; }

GetById(int)
Get a DataObject by its ID.

Declaration Syntax
public IDataObject GetById(int id)

Parameters
id(int)
The ID of the desired DataObject.

GetByName(string)
Get a DataObject by its name.

Declaration Syntax
public IDataObject GetByName(string name)

Parameters
name(string)
The name of the desired DataObject.

GetEnumerator()
Returns an enumerator for the current collection.

Declaration Syntax
public IEnumerator<IDataObject> GetEnumerator()

NamesByType(string)
Returns a list of available DataObject names filtered by type.

Declaration Syntax
public IList<string> NamesByType(string dataType)

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 75
Ansys.AAP.PublicAPIs.Analysis Namespace

Parameters
dataType(string)
The datatype filter.

IDataObjectContainer
IDataObjectContainer Interface

Declaration Syntax
public interface IDataObjectContainer

Table 53: Members

Property DataObjects Returns the DataObject collection.

DataObjects
Returns the DataObject collection.

Declaration Syntax
public IDataObjectCollection DataObjects { get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
76 of ANSYS, Inc. and its subsidiaries and affiliates.
Ansys.AAP.PublicAPIs.Extension Namespace
Declaration Syntax
namespace Ansys.AAP.PublicAPIs.Extension

Table 54: Members

IApplication IApplication Interface


IExtension IExtension Interface
IExtensionAPI IExtensionAPI Interface
IExtensionMgr IExtensionMgr Interface

IApplication
IApplication Interface

Declaration Syntax
public interface IApplication

Table 55: Members

Property ScriptNames Returns a list of available script names.


Method LogError(string) Logs an error message.
Method LogWarning(string) Logs a warning message.
Method ScriptByName(string) Gets a script object by its name.

ScriptNames
Returns a list of available script names.

Declaration Syntax
public IList<string> ScriptNames { get; }

LogError(string)
Logs an error message.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 77
Ansys.AAP.PublicAPIs.Extension Namespace

Declaration Syntax
public void LogError(string msg)

Parameters
msg(string)
The error message.

LogWarning(string)
Logs a warning message.

Declaration Syntax
public void LogWarning(string msg)

Parameters
msg(string)
The warning message.

ScriptByName(string)
Gets a script object by its name.

Declaration Syntax
public object ScriptByName(string name)

Parameters
name(string)
The script name.

IExtension
IExtension Interface

Declaration Syntax
public interface IExtension

Table 56: Members

Property Name Returns the name of this extension.


Property ScriptEngine Returns the IronPython script engine.
Property ScriptScope Returns the IronPython scope.
Property Version Returns the version of this extension.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
78 of ANSYS, Inc. and its subsidiaries and affiliates.
IExtensionAPI

Name
Returns the name of this extension.

Declaration Syntax
public string Name { get; }

ScriptEngine
Returns the IronPython script engine.

Declaration Syntax
public ScriptEngine ScriptEngine { get; }

ScriptScope
Returns the IronPython scope.

Declaration Syntax
public ScriptScope ScriptScope { get; }

Version
Returns the version of this extension.

Declaration Syntax
public int Version { get; }

IExtensionAPI
IExtensionAPI Interface

Declaration Syntax
public interface IExtensionAPI

Table 57: Members

Property Application Returns the IApplication object.


Property Context Returns the current context name (Mechanical, Project,
...).
Property DataModel Returns the IDataModel object.
Property ExtensionMgr Returns the IExtensionMgr object.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 79
Ansys.AAP.PublicAPIs.Extension Namespace

Property Graphics Returns an IGraphics object.


Property Log Returns the ILog object. Useful for reporting messages
and errors.
Property SelectionMgr Returns the ISelectionMgr object. Useful for manipulat-
ing the graphic selection.
Method LockPrePostLicense() Locks the license used by the PRE/POST application.
Method ResultsData(string) Returns an IResultReader object for the specified file.
Method UnlockPrePostLicense() Unlocks the license used by the PRE/POST application.
This is required if you want to manually launch the
ANSYS solver. You must relock the license after its use.
If you don't relock the license, the PRE/POST application
will be in read-only mode.

Application
Returns the IApplication object.

Declaration Syntax
public IApplication Application { get; }

Context
Returns the current context name (Mechanical, Project, ...).

Declaration Syntax
public string Context { get; }

DataModel
Returns the IDataModel object.

Declaration Syntax
public IDataModel DataModel { get; }

ExtensionMgr
Returns the IExtensionMgr object.

Declaration Syntax
public IExtensionMgr ExtensionMgr { get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
80 of ANSYS, Inc. and its subsidiaries and affiliates.
IExtensionAPI

Graphics
Returns an IGraphics object.

Declaration Syntax
public IGraphics Graphics { get; }

Log
Returns the ILog object. Useful for reporting messages and errors.

Declaration Syntax
public ILog Log { get; }

SelectionMgr
Returns the ISelectionMgr object. Useful for manipulating the graphic selection.

Declaration Syntax
public ISelectionMgr SelectionMgr { get; }

LockPrePostLicense()
Locks the license used by the PRE/POST application.

Declaration Syntax
public void LockPrePostLicense()

ResultsData(string)
Returns an IResultReader object for the specified file.

Declaration Syntax
public IResultReader ResultsData(string filename)

Parameters
filename(string)
The name of the results file.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 81
Ansys.AAP.PublicAPIs.Extension Namespace

UnlockPrePostLicense()
Unlocks the license used by the PRE/POST application. This is required if you want to manually launch
the ANSYS solver. You must relock the license after its use. If you don't relock the license, the PRE/POST
application will be in read-only mode.

Declaration Syntax
public void UnlockPrePostLicense()

IExtensionMgr
IExtensionMgr Interface

Declaration Syntax
public interface IExtensionMgr

Table 58: Members

Property CurrentExtension Returns the current IExtension object.


Property Extensions Returns a dictionary of available extensions.key = exten-
sion name. value = IExtension object.

CurrentExtension
Returns the current IExtension object.

Declaration Syntax
public IExtension CurrentExtension { get; }

Extensions
Returns a dictionary of available extensions.key = extension name. value = IExtension object.

Declaration Syntax
public IDictionary<string, IExtension> Extensions { get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
82 of ANSYS, Inc. and its subsidiaries and affiliates.
Ansys.AAP.PublicAPIs.Graphics Namespace
Declaration Syntax
namespace Ansys.AAP.PublicAPIs.Graphics

Table 59: Members

IDraw3DContext Interface to draw 3D features


IGraphics Interface to Graphics features

IDraw3DContext
Interface to draw 3D features

Declaration Syntax
public interface IDraw3DContext

Table 60: Members

Property Color Sets or gets the color (0xff0000 for red,


0x00ff00 for green, and 0x0000ff for blue).
Property DepthTest Sets or gets the DepthTest flag.
Property LineWeight Sets or gets the line weight.
Property Translucency Sets or gets the translucency.
Property Visible Sets or gets the visibility flag of this draw-
ing context.
Method Close() Closes this drawing context.
Method DrawCircle(IEnumerable<double>, Draws a circle with the current color and
double, IEnumerable<double>) line weight.
Method DrawDisc(IEnumerable<double>, Draws a disc with the current color and line
double, IEnumerable<double>) weight.
Method DrawPoints(IEnumerable<double>) Draws a set of points with the current color
and size equal to the current line weight.
Method DrawPolygon(IEnumerable<double>, Draws a polygon with the current color and
IEnumerable<double>) line weight.
Method DrawPolyline(IEnumerable<double>) Draws a polyline with the current color and
line weight.
Method DrawShell(IEnumerable<double>, IE- Draws a surface defined by a set of faces
numerable<double>, IEnumer- (three or four vertices per face). This func-
able<int>) tion can be called directly using the inform-

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 83
Ansys.AAP.PublicAPIs.Graphics Namespace

ation given by the IGeoTessellation inter-


face.
Method DrawShell(IEnumerable<double>, IE- Draws a surface defined by a set of faces
numerable<double>, IEnumer- (three or four vertices per face). This func-
able<int>, IEnumerable<int>) tion can be called directly using the inform-
ation given by the IGeoTessellation inter-
face.

Color
Sets or gets the color (0xff0000 for red, 0x00ff00 for green, and 0x0000ff for blue).

Declaration Syntax
public int Color { set;get; }

DepthTest
Sets or gets the DepthTest flag.

Declaration Syntax
public bool DepthTest { set;get; }

LineWeight
Sets or gets the line weight.

Declaration Syntax
public int LineWeight { set;get; }

Translucency
Sets or gets the translucency.

Declaration Syntax
public double Translucency { set;get; }

Visible
Sets or gets the visibility flag of this drawing context.

Declaration Syntax
public bool Visible { set;get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
84 of ANSYS, Inc. and its subsidiaries and affiliates.
IDraw3DContext

Close()
Closes this drawing context.

Declaration Syntax
public void Close()

DrawCircle(IEnumerable<double>, double, IEnumerable<double>)


Draws a circle with the current color and line weight.

Declaration Syntax
public void DrawCircle(IEnumerable<double> center, double radius, IEnumerable<double> normal)

Parameters
center(IEnumerable<double>)
Coordinates of the center.

radius(double)
Radius of the circle.

normal(IEnumerable<double>)
Vector to identify the axis of the circle.

DrawDisc(IEnumerable<double>, double, IEnumerable<double>)


Draws a disc with the current color and line weight.

Declaration Syntax
public void DrawDisc(IEnumerable<double> center, double radius, IEnumerable<double> normal)

Parameters
center(IEnumerable<double>)
Coordinates of the center.

radius(double)
Radius of the circle.

normal(IEnumerable<double>)
Vector to identify the axis of the circle.

DrawPoints(IEnumerable<double>)
Draws a set of points with the current color and size equal to the current line weight.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 85
Ansys.AAP.PublicAPIs.Graphics Namespace

Declaration Syntax
public void DrawPoints(IEnumerable<double> points)

Parameters
points(IEnumerable<double>)
Array of points coordinates (dimensioned to numPoints*3).

DrawPolygon(IEnumerable<double>, IEnumerable<double>)
Draws a polygon with the current color and line weight.

Declaration Syntax
public void DrawPolygon(IEnumerable<double> points, IEnumerable<double> normals)

Parameters
points(IEnumerable<double>)
Array of points coordinates (dimensioned to numPoints*3).

normals(IEnumerable<double>)
Array of vectors that identify the normal for each point (dimensioned to numPoints*3).

DrawPolyline(IEnumerable<double>)
Draws a polyline with the current color and line weight.

Declaration Syntax
public void DrawPolyline(IEnumerable<double> points)

Parameters
points(IEnumerable<double>)
Array of points coordinates (dimensioned to numPoints*3).

DrawShell(IEnumerable<double>, IEnumerable<double>, IEnumerable<int>)


Draws a surface defined by a set of faces (three or four vertices per face). This function can be called
directly using the information given by the IGeoTessellation interface.

Declaration Syntax
public void DrawShell(IEnumerable<double> vertices, IEnumerable<double> normals, IEnumerable<int>
faces)

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
86 of ANSYS, Inc. and its subsidiaries and affiliates.
IGraphics

Parameters
vertices(IEnumerable<double>)
Array of points coordinates.

normals(IEnumerable<double>)
Array of vectors (one vector per vertex).

faces(IEnumerable<int>)
Array of Indices to describe each face. One face is defined by an integer (three or four) that identify the
number of vertices for this face and the index of each vertex.

DrawShell(IEnumerable<double>, IEnumerable<double>, IEnumerable<int>,


IEnumerable<int>)
Draws a surface defined by a set of faces (three or four vertices per face). This function can be called
directly using the information given by the IGeoTessellation interface.

Declaration Syntax
public void DrawShell(IEnumerable<double> vertices, IEnumerable<double> normals, IEnumerable<int>
faces, IEnumerable<int> colors)

Parameters
vertices(IEnumerable<double>)
Array of points coordinates.

normals(IEnumerable<double>)
Array of vectors (one vector per vertex).

faces(IEnumerable<int>)
Array of Indices to describe each face. One face is defined by an integer (three or four) that identify the
number of vertices for this face and the index of each vertex.

colors(IEnumerable<int>)
Array of colors (one color per vertex).

IGraphics
Interface to Graphics features

Declaration Syntax
public interface IGraphics

Table 61: Members

Property Color Gets or sets the color (0xff0000 for red,


0x00ff00 for green, and 0x0000ff for blue).
Property LineWeight Gets or sets the line weight.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 87
Ansys.AAP.PublicAPIs.Graphics Namespace

Property MainHandle Gets the window handle from the applications


main window.
Property MainWindow Gets the main window object from the applic-
ation.
Property Translucency Gets or sets the translucency.
Method CreateAndOpenDraw3DContext() Creates and opens a 3D Drawing Context.
Method DrawText2D(int, int, string) Draws text in the graphic window at x,y co-
ordinate (given in pixel units).
Method LineTo2D(int, int) Draws a line from the current position to the
x,y coordinate (given in pixel units).
Method MoveTo2D(int, int) Moves the pencil to the x,y coordinate (given
in pixel units).
Method PixelToWorld(IEnumerable<int>) Gets the 3D coordinates from a window co-
ordinate (in pixel units).
Method PixelToWorld(int, int) Gets the 3D coordinates from a window co-
ordinate (in pixel units).
Method WorldToPixel(IEnumer- Gets the window coordinate (in pixel units)
able<double>) from a 3D point.
Method WorldToPixel(double, double, Gets the window coordinate (in pixel units)
double) from a 3D point.

Color
Gets or sets the color (0xff0000 for red, 0x00ff00 for green, and 0x0000ff for blue).

Declaration Syntax
public int Color { set;get; }

LineWeight
Gets or sets the line weight.

Declaration Syntax
public int LineWeight { set;get; }

MainHandle
Gets the window handle from the applications main window.

Declaration Syntax
public IntPtr MainHandle { get; }

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
88 of ANSYS, Inc. and its subsidiaries and affiliates.
IGraphics

MainWindow
Gets the main window object from the application.

Declaration Syntax
public object MainWindow { get; }

Translucency
Gets or sets the translucency.

Declaration Syntax
public double Translucency { set;get; }

CreateAndOpenDraw3DContext()
Creates and opens a 3D Drawing Context.

Declaration Syntax
public IDraw3DContext CreateAndOpenDraw3DContext()

DrawText2D(int, int, string)


Draws text in the graphic window at x,y coordinate (given in pixel units).

Declaration Syntax
public void DrawText2D(int x, int y, string text)

Parameters
x(int)
The x coordinate.

y(int)
The y coordinate.

text(string)
The text to display.

LineTo2D(int, int)
Draws a line from the current position to the x,y coordinate (given in pixel units).

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 89
Ansys.AAP.PublicAPIs.Graphics Namespace

Declaration Syntax
public void LineTo2D(int x, int y)

Parameters
x(int)
The x coordinate.

y(int)
The y coordinate.

MoveTo2D(int, int)
Moves the pencil to the x,y coordinate (given in pixel units).

Declaration Syntax
public void MoveTo2D(int x, int y)

Parameters
x(int)
The x coordinate.

y(int)
The y coordinate.

PixelToWorld(IEnumerable<int>)
Gets the 3D coordinates from a window coordinate (in pixel units).

Declaration Syntax
public double[] PixelToWorld(IEnumerable<int> xy)

Parameters
xy(IEnumerable<int>)
The x and y coordinates as a list of integers.

PixelToWorld(int, int)
Gets the 3D coordinates from a window coordinate (in pixel units).

Declaration Syntax
public double[] PixelToWorld(int x, int y)

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
90 of ANSYS, Inc. and its subsidiaries and affiliates.
IGraphics

Parameters
x(int)
The x coordinate.

y(int)
The y coordinate.

WorldToPixel(IEnumerable<double>)
Gets the window coordinate (in pixel units) from a 3D point.

Declaration Syntax
public int[] WorldToPixel(IEnumerable<double> pt)

Parameters
pt(IEnumerable<double>)
The x,y and z coordinates as a list of doubles.

WorldToPixel(double, double, double)


Gets the window coordinate (in pixel units) from a 3D point.

Declaration Syntax
public int[] WorldToPixel(double x, double y, double z)

Parameters
x(double)
The x coordinate.

y(double)
The y coordinate.

z(double)
The z coordinate.

Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 91
Release 14.5 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
92 of ANSYS, Inc. and its subsidiaries and affiliates.

You might also like