Printer
Package: Libraries.Fabrication.Printers · Inherits from: Libraries.Language.Object, Libraries.Fabrication.Profiles.Profile
The Printer class is a printer profile that a program can make with one line, and the parent of every printer class in this package. On its own it is a generic Marlin printer with a 220 by 220 millimeter bed, printing PLA at safe, slow speeds. The families (BowdenPrinter, DirectDrivePrinter, KlipperPrinter and BambuPrinter) and the models (such as CrealityEnder3) change what their printers need. Its start G-code is written in three parts (GetHeatGcode, GetHomeGcode and GetPrimeGcode), so a printer class changes only the part that differs, such as how it levels its bed.
Example Code
use Libraries.Fabrication.Printers.Printer
Printer printer
printer:SetName("My printer")
printer:SetBed(235, 235, 250)
output printer:Describe()
Actions
GetEndGcode()
This action returns the end G-code: lift away from the print, bring it to the front, and turn the heaters, fan and motors off.
Returns
text: The end G-code.
Example
use Libraries.Fabrication.Printers.Printer
Printer printer
output printer:GetEndGcode()
GetHeatGcode()
This action returns the G-code that starts heating the bed and the nozzle. They heat together, so homing can run while they warm.
Returns
text: The heating G-code.
Example
use Libraries.Fabrication.Printers.Printer
Printer printer
output printer:GetHeatGcode()
GetHomeGcode()
This action returns the G-code that homes the printer, and levels the bed on printers whose classes add it. By default it only homes.
Returns
text: The homing G-code.
Example
use Libraries.Fabrication.Printers.Printer
Printer printer
output printer:GetHomeGcode()
GetPrimeGcode()
This action returns the G-code that waits for the heat, then draws two priming lines near the left edge of the bed, so the nozzle is full of plastic when the print starts.
Returns
text: The priming G-code.
Example
use Libraries.Fabrication.Printers.Printer
Printer printer
output printer:GetPrimeGcode()
GetStartGcode()
This action returns the start G-code: GetHeatGcode, GetHomeGcode and GetPrimeGcode, one after another. Placeholders such as {BED_TEMP} are filled in when the G-code is written.
Returns
text: The start G-code.
Example
use Libraries.Fabrication.Printers.Printer
Printer printer
output printer:GetStartGcode()
Lines(text first, text second)
This action joins two lines of G-code, for printer classes that build their G-code a few lines at a time.
Parameters
firsttext: The first line.secondtext: The second line.
Returns
text: The two lines, one after the other.
Example
use Libraries.Fabrication.Printers.Printer
Printer printer
output printer:Lines("G28 ;home all axes", "G29 ;measure the bed")
SetBed(number width, number depth, number height)
This action sets the printer's bed size and the tallest print it can make, in millimeters.
Parameters
widthnumber: The bed's size from left to right (X).depthnumber: The bed's size from front to back (Y).heightnumber: The tallest print (Z).
Example
use Libraries.Fabrication.Printers.BowdenPrinter
BowdenPrinter printer
printer:SetBed(235, 235, 250)
Inherited Actions
23 actions from Libraries.Fabrication.Profiles.Profile
- Clear(text key)
- Describe()
- GetBambuSettingsFile()
- GetBoolean(text key)
- GetInherits()
- GetInteger(text key)
- GetName()
- GetNumber(text key)
- GetOwnKeys()
- GetParent()
- GetSchema()
- GetSource(text key)
- GetText(text key)
- Set(text key, text value)
- SetBoolean(text key, boolean value)
- SetInherits(text parentName)
- SetInteger(text key, integer value)
- SetName(text value)
- SetNumber(text key, number value)
- SetParent(Libraries.Fabrication.Profiles.Profile value)
- SetsOwn(text key)
- TrySet(text key, text value)
- Validate()