RAProject#
- class ansys.rocky.app.ra_project.RAProject#
Bases:
ansys.rocky.app.api_element_item.ApiElementItemRocky PrePost Scripting wrapper for a project.
The
RAProjectclass serves as the main access point for a project’sRAStudyand the project entities that aren’t directly related to a simulation’s configuration, such as the time filter, the collection of user processes, etc.The
RAProjectcan be obtained directly via the app global object. Example usage:project = app.CreateProject() study = project.GetStudy() user_processes = project.GetUserProcessCollection() input_variables = project.GetInputVariables() project.SaveProject('my_project.rocky') project.SaveProjectForRestart('my_restart_project.rocky', timestep_or_index=10)
Overview#
Get the study model associated with a given model item |
Close the current project. |
|
Save the currently opened project. |
|
Create a new restart project from the current project. |
|
Get the current project’s filename. |
|
Check if the current project has unsaved changes. |
|
Creates a new study and returns its wrapper |
|
Get the project’s Study. |
|
Get the model element associated with the given ID |
|
Get the project’s collection of User Processes. |
|
Utility function to return the api object representing the project’s time filter |
|
Get the PrePost Scripting wrapper for the project’s Parametric Variables. |
|
Get the PrePost Scripting wrapper for the project’s Input Variables. |
|
Removes the given process from the project. |
|
Import detail#
from ansys.rocky.app.ra_project import RAProject
Method detail#
- RAProject.CloseProject(check_save_state: bool = True) None#
Close the current project.
- Parameters:
check_save_state – If False, it will close without asking the user to save it first.
- RAProject.SaveProject(filename: str | None = None) None#
Save the currently opened project.
- Parameters:
filename – The name of the file to save the project or None if to update the current file
- RAProject.SaveProjectForRestart(filename: str, timestep_or_index: RATimeOrIndex | None = None) None#
Create a new restart project from the current project.
- Parameters:
filename – The new filename to be saved.
timestep_or_index – Either the index of the timestep, or the timestep itself, in which to create the restart project. If None is passed, the application’s current timestep will be used.
- RAProject.GetProjectFilename() str#
Get the current project’s filename.
- Returns:
The current project’s file name, or None if there is no current project or if the project hasn’t been saved yet.
- RAProject.HasUnsavedChanges() bool#
Check if the current project has unsaved changes.
- Returns:
True if the project is modified (unsaved changes), False otherwise.
- classmethod RAProject.GetWrappedClass() type[petroapp10.plugins.entities.petroapp10_project.Petroapp10Project]#
- RAProject.CreateStudy(study_name: str | None = None) ansys.rocky.app.ra_study.RAStudy#
Creates a new study and returns its wrapper
- Parameters:
study_name – The name of the study
- RAProject.GetStudy(study_name: str | None = None) ansys.rocky.app.ra_study.RAStudy | None#
Get the project’s Study.
- Parameters:
study_name – The name of the study If None is given the first model will be returned
- classmethod RAProject.GetModelStudy(model_item)#
Get the study model associated with a given model item
- Parameters:
model_item (Subject) – A study child
@return RAStudy or None if no study was found for the given element
- RAProject.GetModelElement(model_element_id)#
Get the model element associated with the given ID
- Parameters:
model_element_id (unicode) – The element id
- @return
The wrapped object with the given ID
- RAProject.GetUserProcessCollection() ansys.rocky.app.ra_user_process_collection.RAUserProcessCollection | None#
Get the project’s collection of User Processes.
- RAProject.GetUserProcess(process_name)#
- RAProject.GetTimeFilter() ansys.rocky.app.ra_time_filter.RATimeFilter | None#
Utility function to return the api object representing the project’s time filter
- RAProject.GetParametricVariables() ansys.rocky.app.ra_parametric_variables.RAParametricVariables#
Get the PrePost Scripting wrapper for the project’s Parametric Variables.
- RAProject.GetInputVariables() ansys.rocky.app.ra_input_variables.RAInputVariables#
Get the PrePost Scripting wrapper for the project’s Input Variables.
- RAProject.RemoveProcess(process: ansys.rocky.app.ra_grid_process_element.RAGridProcessElementItem | str) None#
Removes the given process from the project.
- Parameters:
process – a process or process name
- RAProject.GetElementNames(type_name=None)#