Merge pull request #2317 from mlampert/bugfix/path-job

Path: Bugfix/path job creation
This commit is contained in:
sliptonic
2019-07-03 07:42:29 -05:00
committed by GitHub
4 changed files with 5 additions and 6 deletions

View File

@@ -392,7 +392,7 @@ class ObjectJob:
@classmethod
def baseCandidates(cls):
'''Answer all objects in the current document which could serve as a Base for a job.'''
return sorted([obj for obj in FreeCAD.ActiveDocuemnt.Objects if cls.isBaseCandidate(obj)], key=lambda o: o.Label)
return sorted([obj for obj in FreeCAD.ActiveDocument.Objects if cls.isBaseCandidate(obj)], key=lambda o: o.Label)
@classmethod
def isBaseCandidate(cls, obj):

View File

@@ -95,7 +95,6 @@ def selectionEx():
class ViewProvider:
def __init__(self, vobj):
vobj.Proxy = self
mode = 2
vobj.setEditorMode('BoundingBox', mode)
vobj.setEditorMode('DisplayMode', mode)
@@ -1306,14 +1305,14 @@ def Create(base, template=None):
FreeCAD.ActiveDocument.openTransaction(translate("Path_Job", "Create Job"))
try:
obj = PathJob.Create('Job', base, template)
ViewProvider(obj.ViewObject)
obj.ViewObject.Proxy = ViewProvider(obj.ViewObject)
FreeCAD.ActiveDocument.commitTransaction()
obj.Document.recompute()
obj.ViewObject.Proxy.editObject(obj.Stock)
return obj
except Exception as exc: # pylint: disable=broad-except
PathLog.error(exc)
traceback.print_exc(exc)
traceback.print_exc()
FreeCAD.ActiveDocument.abortTransaction()

View File

@@ -25,7 +25,7 @@ import FreeCAD
from FreeCAD import Units
import datetime
import PathScripts
PostUtils = PathScripts.PostUtils
import PathScripts.PostUtils as PostUtils
TOOLTIP = '''
This is a postprocessor file for the Path workbench. It is used to

View File

@@ -24,7 +24,7 @@
import FreeCAD
import Path
import PathScripts
PostUtils = PathScripts.PostUtils
import PathScripts.PostUtils as PostUtils
TOOLTIP = ''' Example Post, using Path.Commands instead of Path.toGCode strings for Path gcode output. '''