Skip to content

Instantly share code, notes, and snippets.

@yorikvanhavre
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yorikvanhavre/e5b0d21068570a79606d to your computer and use it in GitHub Desktop.
Save yorikvanhavre/e5b0d21068570a79606d to your computer and use it in GitHub Desktop.
def export(objectslist,filename):
gfile = open(filename,"wb") # open the file with write permission
for obj in objectslist:
if hasattr(obj,"Path"): # not all objects might be paths
gfile.write(obj.Path.toGCode()) # this simply dumps the path data as internal gcode
commands = obj.Path.Commands # but we could also do stuff with the commands list
gfile.close()
print "successfully exported " + filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment