Skip to main content

Mechanical scripting interface

PythonResult

Last update: 14.01.2025

class Ansys.ACT.Automation.Mechanical.Results.ScriptableResults.PythonResult

Bases: object

Defines a PythonResult.

Overview

Methods

Name Description
Activate Activate the current object.
AddComment Creates a new child Comment.
AddFigure Creates a new child Figure.
AddImage Creates a new child Image.
ClearGeneratedData ClearGeneratedData method.
Connect Register the python code.
CopyTo Copies all visible properties from this object to another.
CreateParameter Creates a new parameter for a Property.
Delete Run the Delete action.
Duplicate Duplicate method.
Evaluate Evaluate method.
EvaluateAllResults Evaluate all results.
ExportAnimation Run the ExportAnimation action.
GetChildren Gets the list of children, filtered by type.
GetParameter Gets the parameter corresponding to the given property.
GroupAllSimilarChildren Run the GroupAllSimilarChildren action.
GroupSimilarObjects Run the GroupSimilarObjects action.
PropertyByAPIName Get a property by its API name.
PropertyByName Get a property by its unique name.
ReloadProperties Reload properties to update properties provided by the provider.
RemoveParameter Removes the parameter from the parameter set corresponding to the given property.

Properties

Name Description
AllowRecursion Gets or Sets whether the PythonCode allows recursion.
By Gets or sets the By.
Children Gets the list of children.
Comments Gets the list of associated comments.
Connected Gets whether the callbacks are currently connected.
DataModelObjectCategory Gets the current DataModelObject’s category.
DisplayTime Gets or sets the DisplayTime.
Figures Gets the list of associated figures.
Images Gets the list of associated images.
InternalObject Gets the internal object. For advanced usage only.
Location Gets or sets the Location.
Mode Gets or sets the Mode.
Properties Gets the list of properties for this object.
PropertyProvider Gets or sets the propperty provider instance associated with this python code object.
ScriptExecutionScope The scope identifier in which the code execution will take place.
Text Gets or sets the text in the script tab for the Python Code object.
VisibleProperties Gets the list of properties that are visible for this object.

Property detail

property PythonResult.AllowRecursion : bool | None

Gets or Sets whether the PythonCode allows recursion.

property PythonResult.By : Ansys.Mechanical.DataModel.Enums.SetDriverStyle | None

Gets or sets the By.

property PythonResult.Children : List[Ansys.Mechanical.DataModel.Interfaces.IDataModelObject] | None

Gets the list of children.

property PythonResult.Comments : Iterable[Ansys.ACT.Automation.Mechanical.Comment] | None

Gets the list of associated comments.

property PythonResult.Connected : bool | None

Gets whether the callbacks are currently connected.

property PythonResult.DataModelObjectCategory : Ansys.Mechanical.DataModel.Enums.DataModelObjectCategory | None

Gets the current DataModelObject’s category.

property PythonResult.DisplayTime : Ansys.Core.Units.Quantity | None

Gets or sets the DisplayTime.

property PythonResult.Figures : Iterable[Ansys.ACT.Automation.Mechanical.Figure] | None

Gets the list of associated figures.

property PythonResult.Images : Iterable[Ansys.ACT.Automation.Mechanical.Image] | None

Gets the list of associated images.

property PythonResult.InternalObject : Ansys.Common.Interop.DSObjectsAuto.IDSScriptDefinedResultAuto | None

Gets the internal object. For advanced usage only.

property PythonResult.Location : Ansys.ACT.Interfaces.Common.ISelectionInfo | None

Gets or sets the Location.

property PythonResult.Mode : int | None

Gets or sets the Mode.

property PythonResult.Properties : tuple[Ansys.ACT.Automation.Mechanical.Property] | None

Gets the list of properties for this object.

property PythonResult.PropertyProvider : Ansys.ACT.Interfaces.Mechanical.IPropertyProvider | None

Gets or sets the propperty provider instance associated with this python code object.

property PythonResult.ScriptExecutionScope : str | None

The scope identifier in which the code execution will take place.

property PythonResult.Text : str | None

Gets or sets the text in the script tab for the Python Code object.

property PythonResult.VisibleProperties : tuple[Ansys.ACT.Automation.Mechanical.Property] | None

Gets the list of properties that are visible for this object.

Method detail

PythonResult.Activate()

Activate the current object.

PythonResult.AddComment()

Creates a new child Comment.

PythonResult.AddFigure()

Creates a new child Figure.

PythonResult.AddImage(filePath: str)

Creates a new child Image.
If a filePath is provided, the image will be loaded from that file,
if not, the image will be a screen capture of the Geometry window.

PythonResult.ClearGeneratedData()

ClearGeneratedData method.

PythonResult.Connect()

Register the python code.

PythonResult.CopyTo(other: Ansys.ACT.Automation.Mechanical.DataModelObject)

Copies all visible properties from this object to another.

PythonResult.CreateParameter(propName: str)

Creates a new parameter for a Property.

PythonResult.Delete()

Run the Delete action.

PythonResult.Duplicate()

Duplicate method.

PythonResult.Evaluate()

Evaluate method.

PythonResult.EvaluateAllResults()

Evaluate all results.

PythonResult.ExportAnimation(filePath: str, format: Ansys.Mechanical.DataModel.Enums.GraphicsAnimationExportFormat, settings: Ansys.Mechanical.Graphics.AnimationExportSettings)

Run the ExportAnimation action.

PythonResult.GetChildren(recurses: bool, children: List[ChildrenType])

Gets the list of children, filtered by type.

PythonResult.GetParameter(propName: str)

Gets the parameter corresponding to the given property.

PythonResult.GroupAllSimilarChildren()

Run the GroupAllSimilarChildren action.

PythonResult.GroupSimilarObjects()

Run the GroupSimilarObjects action.

PythonResult.PropertyByAPIName(name: str)

Get a property by its API name.
If multiple properties have the same API Name, only the first property with that name will be returned.

PythonResult.PropertyByName(name: str)

Get a property by its unique name.

PythonResult.ReloadProperties()

Reload properties to update properties provided by the provider.

PythonResult.RemoveParameter(propName: str)

Removes the parameter from the parameter set corresponding to the given property.