Code: Select all
def execute(self, obj):
if obj.Gcode:
s = ""
for l in obj.Gcode:
s += str(l)
if s:
path = Path.Path(s)
if obj.OperationPlacement:
base = obj.Placement.Base
for x in range(len(path.Commands)):
if path.Commands[x].Name in movecommands:
new = path.Commands[x]
new.Placement.translate(base)
path.deleteCommand(x)
path.insertCommand(new, x)
obj.Path = path
edit: figured out the extra moves are because the translate is adding that direction even if the original command didn't have it. Working on a fix now.