# Creating a Cut-Plane with Results in a Dataset

This is an example of a `run(scenario)` script that creates and adds a cut-plane with results of mesh in a coarse-graining (cg) dataset of a scenario:

```python
''' This scripts loads the cg_dataset of a scenario and it creates a cut-plane of a specific mesh at each timestep and it is added to the dataset'''

import iota

def run(scenario):

    ## Settings for the cut-plane generation ##
    mesh_name = 'Simulation_Domain'                           #Name of the mesh to be cut
    origin = [0,0,0]                                          #Position [X,Y,Z] for the origin of the cut-plane 
    direction = [0,0,1]                                       #Normal direction [X,Y,Z] of the cut-plane 
    ###########################################

    cg_dataset = scenario.get_cg_dataset()                    # Get the coarse-graining dataset of the scenario
    cg_data = cg.data()                                       # Load the data of the coarse-graining dataset
    NumberOfSteps = len(cg_data.timesteps())                  # Get the number of timesteps of the dataset

    for cont in range(0, 
            cg_data.add_slice(step = cont, mesh=mesh_name,            # Create and save the cut plane for all results and timesteps
                normal=iota.Vector3d(direction), origin=iota.Vector3d(origin))
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://particle-analytics-1.gitbook.io/iota-python-api/examples/creating-cut-planes-dataset.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
