Last active
August 29, 2015 14:13
-
-
Save yorikvanhavre/e5b0d21068570a79606d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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