Plugin Marketplace
Sign in

Documentation

Lua API: every module and type
Lua API · Class

ProjectApi

A value the API hands your plugin; call its methods to read or change it.

API version1.0.0manifest.json"project.plugin": "1.0.0"From PrusaSlicer3.0.0-alpha13Editor stubsDownload .zip

Where it is used

Methods

#add_object

method
api.project:add_object(def: ObjectDefinition) → ModelElement

Adds a new object to the scene using the provided definition table.

Parameters
defObjectDefinition
The configuration table for the new object.
Returns
ModelElementmodel
The newly created object.

#insert_layer_custom_gcode

method
api.project:insert_layer_custom_gcode( bed_inst_ref: BedInstRef, z_depth: number, gcode: string )

Inserts custom G-Code at a specific Z-depth.

Parameters
bed_inst_refBedInstRef
The bed instance to target.
z_depthnumber
The Z-height to insert the G-Code.
gcodestring
The G-Code string.
Returns

Nothing.

#clear_layer_custom_steps

method
api.project:clear_layer_custom_steps(bed_inst_ref: BedInstRef)

Clears all custom layer steps for the given bed instance.

Parameters
bed_inst_refBedInstRef
—
Returns

Nothing.

#current_bed

method
api.project:current_bed() → BedInstRef

Retrieves the currently active bed instance.

Returns

    ↑↓ move↵ openAPI 1.0.0