GithubHelp home page GithubHelp logo

jneilliii / octoprint-gcodemacros Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cp2004/octoprint-gcodemacros

0.0 0.0 0.0 191 KB

Configure custom gcode macros you can use anywhere!

Home Page: https://plugins.octoprint.org/plugins/gcode_macro

License: GNU Affero General Public License v3.0

JavaScript 1.74% Python 94.64% SCSS 1.04% Jinja 2.59%

octoprint-gcodemacros's Introduction

OctoPrint Gcode Macros Plugin

Create custom commands you can add anywhere: in your gcode file, OctoPrint's terminal, gcode scripts, or other plugins to run a configured script.

Use macros for preheating your printer, levelling the bed, changing filament... Possibilities are (nearly) endless!

Installation

Install from the plugin repository or manually using this URL:

https://github.com/cp2004/OctoPrint-GCodeMacros/releases/latest/download/release.zip

Warning: This plugin only supports Python 3 installs. To find out more about upgrading your OctoPrint install to Python 3, you can take a look at this post

Warning 2: Don't try installing this plugin from the source code on GitHub, there may be some breakage as the CSS is only built on releases. If you are interested in contributing, please see the Contribution Guidelines

Configuration

Once installed, you can start defining your macros.

Macro Commands

All commands are prefixed with an @, so they don't interfere with standard gcode commands. However, this means that some commands are reserved. OctoPrint uses these specific commands for pausing & resuming prints, but also other plugins can use custom @ commands. For example, OctoLapse uses @OCTOLAPSE TAKE-SNAPSHOT or the WLED plugin uses @WLED ON or @WLED OFF to control some LEDs.

The commands are case-sensitive, and you can have spaces, numbers and punctuation in them!

These commands will not work while printing from the printer's SD card

Macro Content

Macros can contain anything, even other macros!

You can nest macros up to 5 levels deep. For example, you may have a macro @preheat, and one for @bedlevel. Maybe you want to preheat your bed before running the levelling commands!

In addition to nesting commands, you can also use the Jinja2 template syntax to implement some logic in scripts. For example, this one will make the printer move to a random position in X and Y:

@random

G1 X{{ range(200) | random}} Y{{ range(200) | random }} F3000.0;

Or maybe you fancy having a bit of fun, making your printer into a random number generator:

@random-number

M117 Random number... {{ range(100) | random }}!

See the full Jinja2 Template Designer Documentation for more information about the templates

Sponsors

As well as 5 others supporting me regularly through GitHub Sponsors!

Supporting my efforts

I created this project in my spare time, so if you have found it useful or enjoyed using it then please consider supporting it's development!. You can sponsor monthly or one time, for any amount you choose.

๐Ÿ‘ท

octoprint-gcodemacros's People

Contributors

cp2004 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.