Kyle_Espn
Posts: 1
Joined: Mon Sep 25, 2023 2:20 pm

Post Processing Python Script Issues

Howdy y'all,

I have been working on a python script that translates gcode into a scripting language for a 6 axis robot. The script itself works perfectly from both inside the IDE and inside a command prompt. The script allows me to pass arguments to it in both of these places. Where I have been having trouble is from within the post processing section of Simplify3D. I have an arcwelding script right above this that works perfectly but the script I have written refuses to work.
Simplify3D troubleshooting.PNG
For reference, I am on V5.1.2. I have tried repackaging the script as an executable, rewriting how the input arguments are handled, passing the full file path rather than just the file name, running the script alone (without the first script above it), and many more troubleshooting methods.

From what I have seen, it looks like the script is failing to open successfully. This is once again strange since I can run the script flawlessly from within the command prompt and IDE. I cannot even run a "Hello World" script that I have written. My best guess now is maybe the script needs to open a console to successfully run the code? I wouldn't know how to test for that so now I am just lost.

Can anyone help me on my troubleshooting journey? Any help would be very much appreciated. I have included the code snippet below that handles the argument input:

def gcode_input():

global file_name
file_obj = ""

try:
args = sys.argv
file_name = args[1]
file_obj = open(file_name + ".GCODE", 'r')
except:
file_name = input("Enter G-Code file name-->")
file_obj = open(file_name + ".GCODE", 'r')

raw_gcode = []
for line in file_obj:
raw_gcode.append(line)
file_obj.close()

return raw_gcode
S3D-Jason
Posts: 1409
Joined: Sun May 31, 2015 6:01 am

Re: Post Processing Python Script Issues

There's another thread here that might be useful:
viewtopic.php?t=16825

But in general, I would use something like:
C:\path\to\python.exe C:\path\to\script.py

Use the full paths with .exe and .py extensions and it should work.
blj1884
Posts: 45
Joined: Mon Jan 30, 2017 8:34 am

Re: Post Processing Python Script Issues

Here is one I made for the Diabase H-Series if it helps you.

You can find all of the project files here:
https://drive.google.com/drive/folders/ ... sp=sharing
Attachments
H-Series_gCode_PostProcessor.pdf
(99.13 KiB) Downloaded 30 times
H-Series Universal FFF Profile.fff
(32.18 KiB) Downloaded 26 times
H-Series_gCode_PostProcessor_V1.8.txt
(31.91 KiB) Downloaded 34 times

Return to “Troubleshooting and Bug Reports”