PythonCode#

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

Bases: object

Defines a PythonCode.

Overview#

ReloadProperties

Reload properties to update properties provided by the provider.

Connect

Register the python code.

Delete

Run the Delete action.

Activate

Activate the current object.

CopyTo

Copies all visible properties from this object to another.

Duplicate

Creates a copy of the current DataModelObject.

GroupAllSimilarChildren

Run the GroupAllSimilarChildren action.

GroupSimilarObjects

Run the GroupSimilarObjects action.

PropertyByName

Get a property by its unique name.

PropertyByAPIName

Get a property by its API name.

CreateParameter

Creates a new parameter for a Property.

GetParameter

Gets the parameter corresponding to the given property.

RemoveParameter

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

Text

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

PropertyProvider

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

InternalObject

Gets the internal object. For advanced usage only.

ScriptExecutionScope

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

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.

VisibleProperties

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

Property detail#

property PythonCode.Text: System.String | None

Gets or sets the text in the script tab for the Python Code 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.InternalObject: Ansys.Common.Interop.DSObjectsAuto.IDSPythonCodeAuto | None

Gets the internal object. For advanced usage only.

property PythonCode.ScriptExecutionScope: System.String | None

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

property PythonCode.Connected: System.Boolean | 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: System.Object | None

Gets the internal object. For advanced usage only.

property PythonCode.Properties: System.Collections.Generic.IReadOnlyList[Ansys.ACT.Automation.Mechanical.Property] | None

Gets the list of properties for this object.

property PythonCode.VisibleProperties: System.Collections.Generic.IReadOnlyList[Ansys.ACT.Automation.Mechanical.Property] | None

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

Method detail#

PythonCode.ReloadProperties() System.Void

Reload properties to update properties provided by the provider.

PythonCode.Connect() System.Void

Register the python code.

PythonCode.Delete() System.Void

Run the Delete action.

PythonCode.Activate() System.Void

Activate the current object.

PythonCode.CopyTo(other: Ansys.ACT.Automation.Mechanical.DataModelObject) System.Void

Copies all visible properties from this object to another.

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

Creates a copy of the current DataModelObject.

PythonCode.GroupAllSimilarChildren() System.Void

Run the GroupAllSimilarChildren action.

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

Run the GroupSimilarObjects action.

PythonCode.PropertyByName(name: System.String) Ansys.ACT.Automation.Mechanical.Property

Get a property by its unique name.

PythonCode.PropertyByAPIName(name: System.String) 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.CreateParameter(propName: System.String) Ansys.ACT.Interfaces.Mechanical.IParameter

Creates a new parameter for a Property.

PythonCode.GetParameter(propName: System.String) Ansys.ACT.Interfaces.Mechanical.IParameter

Gets the parameter corresponding to the given property.

PythonCode.RemoveParameter(propName: System.String) System.Void

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