Merge pull request #2317 from mlampert/bugfix/path-job
Path: Bugfix/path job creation
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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. '''
|
||||
|
||||
|
||||
Reference in New Issue
Block a user