> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RAProject

### *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`](https://developer.synopsys.com/docs/rocky/rocky-prepost-scripting/RAStudy#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 theme={null}
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:**

| Name | Description |
| - | - |
| [`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. |
| [`HasUnsavedChanges`](#generated.RAProject.HasUnsavedChanges)() | Check if the current project has unsaved changes. |
| [`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. |

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

#### CreateStudy(study\_name: str | None = None)

Creates a new study and returns its wrapper

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

#### GetInputVariables()

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

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

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

#### GetParametricVariables()

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

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

#### GetStudy(study\_name: str | None = None)

Get the project’s Study.

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

#### GetTimeFilter()

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

#### GetUserProcessCollection()

Get the project’s collection of User Processes.

#### HasUnsavedChanges()

Check if the current project has unsaved changes.

* **Returns:**
  True if the project is modified (unsaved changes), False otherwise.

#### RemoveProcess(process: RAGridProcessElementItem | str)

Removes the given process from the project.

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

#### SaveProject(filename: str | 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

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