Beispiel #1
0
 def setupSetupSheet(self, obj):
     if not hasattr(obj, 'SetupSheet'):
         obj.addProperty('App::PropertyLink', 'SetupSheet', 'Base', QtCore.QT_TRANSLATE_NOOP('PathJob', 'SetupSheet holding the settings for this job'))
         obj.SetupSheet = PathSetupSheet.Create()
         if obj.SetupSheet.ViewObject:
             PathIconViewProvider.Attach(obj.SetupSheet.ViewObject, 'SetupSheet')
     self.setupSheet = obj.SetupSheet.Proxy
def Create(name='PropertyBag'):
    '''Create(name = 'PropertyBag') ... creates a new setup sheet'''
    FreeCAD.ActiveDocument.openTransaction(
        translate("PathPropertyBag", "Create PropertyBag"))
    pcont = PathPropertyBag.Create(name)
    PathIconViewProvider.Attach(pcont.ViewObject, name)
    return pcont
Beispiel #3
0
 def Create(self, name='ToolBit', shapeFile=None):
     '''Create(name = 'ToolBit') ... creates a new tool bit.
     It is assumed the tool will be edited immediately so the internal bit body is still attached.'''
     FreeCAD.ActiveDocument.openTransaction(translate('PathToolBit', 'Create ToolBit'))
     tool = PathToolBit.ToolBitFactory.Create(self, name, shapeFile)
     PathIconViewProvider.Attach(tool.ViewObject, name)
     FreeCAD.ActiveDocument.commitTransaction()
     return tool
    def Create(self, name="ToolBit", shapeFile=None, path=None):
        """Create(name = 'ToolBit') ... creates a new tool bit.
        It is assumed the tool will be edited immediately so the internal bit body is still attached."""

        PathLog.track(name, shapeFile, path)
        FreeCAD.ActiveDocument.openTransaction("Create ToolBit")
        tool = PathToolBit.ToolBitFactory.Create(self, name, shapeFile, path)
        PathIconViewProvider.Attach(tool.ViewObject, name)
        FreeCAD.ActiveDocument.commitTransaction()
        return tool
Beispiel #5
0
def createResourceClone(obj, orig, name, icon):
    if isArchPanelSheet(orig):
        # can't clone panel sheets - they have to be panel sheets
        return orig

    clone = Draft.clone(orig)
    clone.Label = "%s-%s" % (name, orig.Label)
    clone.addProperty('App::PropertyString', 'PathResource')
    clone.PathResource = name
    if clone.ViewObject:
        PathIconViewProvider.Attach(clone.ViewObject, icon)
        clone.ViewObject.Visibility = False
    obj.Document.recompute()  # necessary to create the clone shape
    return clone
Beispiel #6
0
def Create(name='SetupSheet'):
    '''Create(name = 'SetupSheet') ... creates a new setup sheet'''
    FreeCAD.ActiveDocument.openTransaction(translate("Path_Job", "Create Job"))
    ssheet = PathSetupSheet.Create(name)
    PathIconViewProvider.Attach(ssheet, name)
    return ssheet
def Create(name="PropertyBag"):
    """Create(name = 'PropertyBag') ... creates a new setup sheet"""
    FreeCAD.ActiveDocument.openTransaction("Create PropertyBag")
    pcont = PathPropertyBag.Create(name)
    PathIconViewProvider.Attach(pcont.ViewObject, name)
    return pcont
def Create(name="SetupSheet"):
    """Create(name='SetupSheet') ... creates a new setup sheet"""
    FreeCAD.ActiveDocument.openTransaction("Create Job")
    ssheet = PathSetupSheet.Create(name)
    PathIconViewProvider.Attach(ssheet, name)
    return ssheet