Skip to content

CuraAPI

Joey de l'Arago edited this page Feb 17, 2023 · 1 revision

Getting started

To use the API in your plug-in, simply get the API object from CuraApplication:

# The application instance is often already passed into the main class of your plugin.
def __init__(application: "CuraApplication") -> None:
    self._api = application.getCuraAPI()

# or

# Otherwise, just call getInstance() on the CuraApplication class to get it.
from cura.CuraApplication import CuraApplication
api = CuraApplication.getInstance().getCuraAPI()

# or

# As a final resort, you can also create a new instance of CuraAPI yourself, but this is deprecated.
from cura.API import CuraAPI
api = CuraAPI()

Now you can use the public properties on api.

Functionality

Clone this wiki locally