PythonCode#

class ansys.mechanical.stubs.v242.Ansys.ACT.Automation.Mechanical.PythonCode#

Bases: object

Defines a PythonCode.

Overview#

Activate

Activate the current object.

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.

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.

AllowRecursion

Gets or Sets whether the PythonCode allows recursion.

Connected

Gets whether the callbacks are currently connected.

DataModelObjectCategory

Gets the current DataModelObject's category.

InternalObject

Gets the internal object. For advanced usage only.

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 PythonCode.AllowRecursion: bool | None#

Gets or Sets whether the PythonCode allows recursion.

property PythonCode.Connected: bool | None#

Gets whether the callbacks are currently connected.

property PythonCode.DataModelObjectCategory: Ansys.Mechanical.DataModel.Enums.DataModelObjectCategory | None#

Gets the current DataModelObject's category.

property PythonCode.InternalObject: Ansys.Common.Interop.DSObjectsAuto.IDSPythonCodeAuto | None#

Gets the internal object. For advanced usage only.

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

Gets the list of properties for this object.

property PythonCode.PropertyProvider: Ansys.ACT.Interfaces.Mechanical.IPropertyProvider | None#

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

property PythonCode.ScriptExecutionScope: str | None#

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

property PythonCode.Text: str | None#

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

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

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

Method detail#

PythonCode.Activate() None#

Activate the current object.

PythonCode.Connect() None#

Register the python code.

PythonCode.CopyTo(other: Ansys.ACT.Automation.Mechanical.DataModelObject) None#

Copies all visible properties from this object to another.

PythonCode.CreateParameter(propName: str) Ansys.ACT.Interfaces.Mechanical.IParameter#

Creates a new parameter for a Property.

PythonCode.Delete() None#

Run the Delete action.

PythonCode.Duplicate() Ansys.Mechanical.DataModel.Interfaces.IDataModelObject#

Duplicate method.

PythonCode.GetParameter(propName: str) Ansys.ACT.Interfaces.Mechanical.IParameter#

Gets the parameter corresponding to the given property.

PythonCode.GroupAllSimilarChildren() None#

Run the GroupAllSimilarChildren action.

PythonCode.GroupSimilarObjects() Ansys.ACT.Automation.Mechanical.TreeGroupingFolder#

Run the GroupSimilarObjects action.

PythonCode.PropertyByAPIName(name: str) Ansys.ACT.Automation.Mechanical.Property#
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.
PythonCode.PropertyByName(name: str) Ansys.ACT.Automation.Mechanical.Property#

Get a property by its unique name.

PythonCode.ReloadProperties() None#

Reload properties to update properties provided by the provider.

PythonCode.RemoveParameter(propName: str) None#

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