    

 ## On this page

  

 

 # RAProject

 Last update: 17.07.2025 

<a id="generated.RAProject"></a>

### *class* RAProject

Rocky PrePost Scripting wrapper for a project.

The [`RAProject`](#generated.RAProject) class serves as the main access point for a project’s [`RAStudy`](RAStudy.md#generated.RAStudy)and 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 [`RAProject`](#generated.RAProject) can be obtained directly via the app global object. Example usage:

```python
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)

```

**Methods:**

NameDescription[`CloseProject`](#generated.RAProject.CloseProject)(\[check\_save\_state\])Close the current project.[`CreateStudy`](#generated.RAProject.CreateStudy)(\[study\_name\])Creates a new study and returns its wrapper[`GetInputVariables`](#generated.RAProject.GetInputVariables)()Get the PrePost Scripting wrapper for the project's Input Variables.[`GetModelElement`](#generated.RAProject.GetModelElement)(model\_element\_id)Get the model element associated with the given ID[`GetModelStudy`](#generated.RAProject.GetModelStudy)(model\_item)Get the study model associated with a given model item[`GetParametricVariables`](#generated.RAProject.GetParametricVariables)()Get the PrePost Scripting wrapper for the project's Parametric Variables.[`GetProjectFilename`](#generated.RAProject.GetProjectFilename)()Get the current project's filename.[`GetStudy`](#generated.RAProject.GetStudy)(\[study\_name\])Get the project's Study.[`GetTimeFilter`](#generated.RAProject.GetTimeFilter)()Utility function to return the api object representing the project's time filter[`GetUserProcessCollection`](#generated.RAProject.GetUserProcessCollection)()Get the project's collection of User Processes.[`RemoveProcess`](#generated.RAProject.RemoveProcess)(process)Removes the given process from the project.[`SaveProject`](#generated.RAProject.SaveProject)(\[filename\])Save the currently opened project.[`SaveProjectForRestart`](#generated.RAProject.SaveProjectForRestart)(filename\[, ...\])Create a new restart project from the current project.<a id="generated.RAProject.CloseProject"></a>

#### CloseProject(check\_save\_state: bool = True)

Close the current project.

- **Parameters:****check\_save\_state** – If False, it will close without asking the user to save it first.

<a id="generated.RAProject.CreateStudy"></a>

#### CreateStudy(study\_name: Optional\[str\] = None)

Creates a new study and returns its wrapper

- **Parameters:****study\_name** – The name of the study

<a id="generated.RAProject.GetInputVariables"></a>

#### GetInputVariables()

Get the PrePost Scripting wrapper for the project’s Input Variables.

<a id="generated.RAProject.GetModelElement"></a>

#### 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

<a id="generated.RAProject.GetModelStudy"></a>

#### *classmethod* 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

<a id="generated.RAProject.GetParametricVariables"></a>

#### GetParametricVariables()

Get the PrePost Scripting wrapper for the project’s Parametric Variables.

<a id="generated.RAProject.GetProjectFilename"></a>

#### GetProjectFilename()

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.

<a id="generated.RAProject.GetStudy"></a>

#### GetStudy(study\_name: Optional\[str\] = None)

Get the project’s Study.

- **Parameters:****study\_name** – The name of the study If None is given the first model will be returned

<a id="generated.RAProject.GetTimeFilter"></a>

#### GetTimeFilter()

Utility function to return the api object representing the project’s time filter

<a id="generated.RAProject.GetUserProcessCollection"></a>

#### GetUserProcessCollection()

Get the project’s collection of User Processes.

<a id="generated.RAProject.RemoveProcess"></a>

#### RemoveProcess(process: rocky30.plugins.api.ra\_grid\_process\_element.RAGridProcessElementItem | str)

Removes the given process from the project.

- **Parameters:****process** – a process or process name

<a id="generated.RAProject.SaveProject"></a>

#### SaveProject(filename: Optional\[str\] = 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

<a id="generated.RAProject.SaveProjectForRestart"></a>

#### SaveProjectForRestart(filename: str, timestep\_or\_index: Optional\[Union\[TimeStep, int\]\] = 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.