Managing a project

What is a "project" ?

A project is a reflection of the InstantTerra status.

For example, save to a file and reload later to continue your work.

# Create an instance
from wysilab import InstantTerra
it = InstantTerra()

# Get the current project
project = it.project

Creating a new project or a project "by default"

Note

When you start an instance of InstantTerra, a new project is created automatically.

# Create a new project (default project)
project.new()

The new() method replaces the current project with a new default project.

Warning

If you have made changes to your project and are trying to open another project, these changes will be lost!

Saving a project

# Save the current project
project.save("my_project.terrain")

The save(filename) method saves the current project to a file.

Note

The saved file does not have a default extension; you must add .terrain to the end of the file name.

Opening a project

# Open a project
project.open("my_project.terrain")

The open(filename) method opens an InstantTerra project from the specified file.

Warning

If you have made changes to your project and are trying to open another project, these changes will be lost!

Closing a project

# Close the current project
project.close()

The close() method closes the current project.

Warning

If you have made changes to your project and are trying to open another project, these changes will be lost!


Copyright © 2022 · All Rights Reserved · Wysilab