IWorkflow#
- class IWorkflow#
Bases: ansys.engineeringworkflow.api.IWorkflowInstance
, abc.ABC
Represents a ModelCenter workflow.
Overview#
Set the value of a datapin. |
|
Get the state of a datapin. |
|
Get the metadata from a datapin. |
|
Create a link to a given datapin based on a given equation. |
|
Save the workflow. |
|
Save the workflow to a file. |
|
Close the workflow. |
|
Get a datapin with a given name. |
|
Get a component from the workflow. |
|
Remove a component from the workflow. |
|
Create an assembly in the workflow. |
|
Automatically link two components. |
|
Get a list of all links in the workflow. |
|
Get the unique ID for the workflow. |
|
Stop execution of the workflow in ModelCenter. |
|
Move a component to the parent at the given index. |
|
Get the named assembly or the top-level assembly. |
|
Create a component. |
Full path of the workflow. |
Import detail#
from ansys.modelcenter.workflow.api.iworkflow import IWorkflow
Property detail#
Method detail#
- abstract IWorkflow.set_value(var_name: str, value: ansys.tools.variableinterop.IVariableValue) None #
Set the value of a datapin.
- Parameters:
- var_name
str
Full ModelCenter path of the datapin.
- value
atvi.IVariableValue
New value to set.
- var_name
- Raises:
InvalidInstanceError
If a datapin with the given name does not exist.
- abstract IWorkflow.get_datapin_state(var_name: str) ansys.tools.variableinterop.VariableState #
Get the state of a datapin.
- Parameters:
- var_name
str
Full ModelCenter path of the datapin.
- var_name
- Returns:
VariableState
Value as a
VariableState
.
- Raises:
InvalidInstanceError
If a datapin with the given name does not exist.
- abstract IWorkflow.get_datapin_meta_data(name: str) ansys.tools.variableinterop.CommonVariableMetadata #
Get the metadata from a datapin.
- Parameters:
- name
str
Full name of the datapin.
- name
- Returns:
atvi.CommonVariableMetadata
Metadata of the datapin.
- Raises:
InvalidInstanceError
If a datapin with the given name does not exist.
- abstract IWorkflow.create_link(datapin: ansys.modelcenter.workflow.api.idatapin.IDatapin | str, equation: str | ansys.modelcenter.workflow.api.idatapin.IDatapin) None #
Create a link to a given datapin based on a given equation.
- Parameters:
- Raises:
InvalidInstanceError
If either the target or equation datapin does not exist.
- abstract IWorkflow.save_workflow_as(file_name: str) None #
Save the workflow to a file.
- Parameters:
- file_name
str
Path to save the workflow in.
- file_name
- abstract IWorkflow.get_datapin(name: str) ansys.modelcenter.workflow.api.idatapin.IDatapin #
Get a datapin with a given name.
- Parameters:
- name
str
Full ModelCenter path of the datapin.
- name
- Returns:
IDatapin
Datapin with the given name.
- Raises:
InvalidInstanceError
If a datapin with the given name does not exist.
- abstract IWorkflow.get_component(name: str) ansys.modelcenter.workflow.api.icomponent.IComponent #
Get a component from the workflow.
- Parameters:
- name
str
Full path and file name to the component.
- name
- Returns:
IComponent
Component with the given name.
- Raises:
InvalidInstanceError
If a component with the given name does not exist.
- abstract IWorkflow.remove_component(name: str) None #
Remove a component from the workflow.
- Parameters:
- name
str
Full ModelCenter path of the component.
- name
- Raises:
InvalidInstanceError
If a component with the given name does not exist.
- abstract IWorkflow.create_assembly(name: str, parent: ansys.modelcenter.workflow.api.iassembly.IAssembly | str, assembly_type: ansys.modelcenter.workflow.api.iassembly.AssemblyType | None = None) ansys.modelcenter.workflow.api.iassembly.IAssembly #
Create an assembly in the workflow.
- Parameters:
- name
str
Name of the new assembly.
- parent
Union
[IAssembly
,str
] Full ModelCenter path of the parent
IAssembly
object or anIAssembly
object that represents it.- assembly_type
AssemblyType
,optional
Type of the assembly to create. Pass
None
to create a regular data-dependency assembly. (This is equivalent to passingAssemblyType.ASSEMBLY
.)
- name
- Returns:
IAssembly
Created assembly.
- abstract IWorkflow.auto_link(src_comp: ansys.modelcenter.workflow.api.icomponent.IComponent | str, dest_comp: ansys.modelcenter.workflow.api.icomponent.IComponent | str) Collection[ansys.modelcenter.workflow.api.idatapin_link.IDatapinLink] #
Automatically link two components.
- Parameters:
- Returns:
Collection
[IDatapinLink
]Collection of the created links.
- Raises:
InvalidInstanceError
If either the source or destination component does not exist.
- abstract IWorkflow.get_links() Collection[ansys.modelcenter.workflow.api.idatapin_link.IDatapinLink] #
Get a list of all links in the workflow.
- Returns:
Collection
[IDatapinLink
]Iterable over datapin links.
- abstract IWorkflow.move_component(component: ansys.modelcenter.workflow.api.icomponent.IComponent | str, parent: ansys.engineeringworkflow.api.IControlStatement | str, index: int = -1) None #
Move a component to the parent at the given index.
- Parameters:
- component
Union
[IComponent
,str
] Component to move.
- parent
str
Owning object of the component.
- index
int
,optional
Position in the parent.
- component
- Raises:
InvalidInstanceError
If the target component does not exist.
- abstract IWorkflow.get_assembly(name: str | None = None) ansys.modelcenter.workflow.api.iassembly.IAssembly #
Get the named assembly or the top-level assembly.
- Parameters:
- name
str
,optional
Full name of the desired assembly. If
None
is passed, the root assembly of the workflow is returned.
- name
- Raises:
InvalidInstanceError
If an assembly with the given name does not exist.
- abstract IWorkflow.create_component(server_path: str, name: str, parent: ansys.engineeringworkflow.api.IControlStatement | str, *, init_string: str | None = None, av_position: Tuple[int, int] | None = None, insert_before: ansys.modelcenter.workflow.api.icomponent.IComponent | ansys.modelcenter.workflow.api.iassembly.IAssembly | str | None = None) ansys.modelcenter.workflow.api.icomponent.IComponent #
Create a component.
- Parameters:
- server_path
str
Source path of the new component, such as the URL to the component in ModelCenter Remote Execution.
- name
str
Name of the new component.
- parent
Union
[aew_api.IControlStatement
,str
] Parent assembly of the component.
- init_string: str, optional
Initialization string.
- av_position: Tuple[int, int], optional
Position in the analysis view to insert the component at.
- insert_before: Union[IComponent, IAssembly, str], optional
Component before where this component is to be inserted.
- Returns
- ——-
- IComponent
Created component.
- server_path