Component#

class Component(element_id: ansys.api.modelcenter.v0.element_messages_pb2.ElementId, engine: ansys.modelcenter.workflow.grpc_modelcenter.engine.Engine)#

Bases: ansys.modelcenter.workflow.grpc_modelcenter.abstract_renamable.AbstractRenamableElement, ansys.modelcenter.workflow.grpc_modelcenter.abstract_datapin_container.AbstractGRPCDatapinContainer, ansys.modelcenter.workflow.grpc_modelcenter.abstract_assembly_child.AbstractAssemblyChild, ansys.modelcenter.workflow.api.IComponent

Defines the component in the workflow.

Note

This class should not be directly instantiated by clients. Get a Workflow object from an instantiated Engine instance and use it to get a valid instance of this object.

Overview#

get_source

Get the source of the component.

invoke_method

Invoke one of the component’s methods.

invalidate

Invalidate the component and all of its datapins.

reconnect

Reload the component from its source.

download_values

Download the component’s datapin values from the server if it is a

is_connected

Flag indicating if the component is connected to its source.

pacz_url

URL to the PACZ file or directory.

__eq__

Return self==value.

Import detail#

from ansys.modelcenter.workflow.grpc_modelcenter.component import Component

Property detail#

property Component.is_connected: bool#

Flag indicating if the component is connected to its source.

property Component.pacz_url: str | None#

URL to the PACZ file or directory.

The URL may be absolute or relative. If relative, the URL must be relative to the workflow definition. While all components are represented by PACZ definitions, in the short term, many components are not currently defined in this way. If there is not a PACZ definition of the component, the method returns None. In such cases, you must fall back on engine-specific methods to determine what the component type is.

Method detail#

Component.__eq__(other)#

Return self==value.

Component.get_source() str#

Get the source of the component.

Returns:
str

Source of the component.

Component.invoke_method(method: str) None#

Invoke one of the component’s methods.

Parameters:
methodstr

Name of the method.

Component.invalidate() None#

Invalidate the component and all of its datapins.

Component.reconnect() None#

Reload the component from its source.

Component.download_values() None#

Download the component’s datapin values from the server if it is a ModelCenter Remote Execution component.