Simple G-Code Generator

  • vicstransam
  • Away
  • New Member
  • New Member
More
30 Aug 2025 23:26 #334161 by vicstransam
Replied by vicstransam on topic Simple G-Code Generator
I had to use "2to3" to try and convert them to Python3 and was able to get the GUI's to work on Bezel and a few others and then I filled out the the dimensions and hit "Write to Axis" but it always errored with "No percent sign or M2" and discarded the gcode file. I couldn't get them to write to the clipboard either. I couldn't get "Engrave" or "Bolt pattern" to run without "indentions or tab" errors.

Please Log in or Create an account to join the conversation.

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
30 Aug 2025 23:30 #334162 by tommylight
Replied by tommylight on topic Simple G-Code Generator
"No percent sign or M2"
Means there is no % at the start and end of the gcode file, or M2 at the end.
See if those can be added as a header and/Or footer, or maybe as post processor?
All this is a stab in the dark from what i know using Inkscape where both above options work fine for LinuxCNC.

Please Log in or Create an account to join the conversation.

  • vicstransam
  • Away
  • New Member
  • New Member
More
31 Aug 2025 03:01 #334168 by vicstransam
Replied by vicstransam on topic Simple G-Code Generator
Yes, you are correct. The way the python script creates the gcode in this particular script is by using trigonometry to find the coordinates and writing to sys.stdout. I did find a preamble and postamble in the py file and I found the postamble was correct with an M2 so I think it has something to do with the way it sends the code to Axis.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
31 Aug 2025 17:02 #334191 by andypugh
Replied by andypugh on topic Simple G-Code Generator
is there any indication that the postamble is being sent?

Please Log in or Create an account to join the conversation.

  • vicstransam
  • Away
  • New Member
  • New Member
More
31 Aug 2025 21:43 #334202 by vicstransam
Replied by vicstransam on topic Simple G-Code Generator
It is an assumption. I click on "Write to Axis" and I notice that Axis says "filtering" at the bottom right but nothing is received. I then exit the py script gui after a few minutes of waiting for it to post code and that's when axis gives the message about the % sign or M2. It could be it never got anything.
I may change the "sys.stdout.write" to create a file instead and see if it post.
There may be something else in the py script that hangs it up. These scripts all ran fine on the python version that comes with Wheezy on my other machine but they don't like Python 3 and using 2to3 doesn't fix everything.

Please Log in or Create an account to join the conversation.

  • vicstransam
  • Away
  • New Member
  • New Member
More
31 Aug 2025 22:01 #334203 by vicstransam
Replied by vicstransam on topic Simple G-Code Generator
I may also try to run the script in terminal and see what I can find out.

Please Log in or Create an account to join the conversation.

Time to create page: 0.064 seconds
Powered by Kunena Forum