Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PrusaSlicer gcode file compatibility #34

Open
aissak21 opened this issue May 3, 2022 · 2 comments
Open

PrusaSlicer gcode file compatibility #34

aissak21 opened this issue May 3, 2022 · 2 comments

Comments

@aissak21
Copy link

aissak21 commented May 3, 2022

The following code chunk worked well for a gcode file sliced in CURA but not in PrusaSlicer. Now I get error: word 'P' value invalid. Is there a way to go about this to parse this file with pygcode, perhaps if it's not a compatibility issue? There is a PyGcode extension for Prusa but it's for adding gcode into the file via python.

from pygcode import Line
    gcode_lines = []
    gcode_block = []
    gcode_params = []
    
    with open(test_file2, 'r') as test:
      for line_text in test.readlines():
          line = Line(line_text) # decode gcode line
          line.block.gcodes  # list of gcodes
          line.block.modal_params  # motion modal parameters
          
          gcode_lines.append(line)
          gcode_block.append(line.block.gcodes)
          gcode_params.append(line.block.modal_params)
    
    print(gcode_block, sep='\n') 
Copy link

In my file, I've encountered:
word 'P' value invalid, solved by commenting M862.3 P "MK3S" ; printer model check
block code remaining '.1', solved by commenting M115 U3.10.1 ; tell printer latest fw version
word 'W' value invalid, solved by commenting G28 W ; home all without mesh bed level

@rongith
Copy link

rongith commented Apr 3, 2023

Check there: https://github.com/emorybarlow/pygcode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants