コード例 #1
0
ファイル: PathJob.py プロジェクト: zqsgdnq/FreeCAD
 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
コード例 #2
0
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
コード例 #3
0
ファイル: PathToolBitGui.py プロジェクト: serpahimor/FreeCAD
 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
コード例 #4
0
    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
コード例 #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
コード例 #6
0
ファイル: PathSetupSheetGui.py プロジェクト: ycho98/FreeCAD
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
コード例 #7
0
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
コード例 #8
0
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