コード例 #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.ViewProvider(obj.SetupSheet.ViewObject, 'SetupSheet')
     self.setupSheet = obj.SetupSheet.Proxy
コード例 #2
0
def SetupStockObject(obj, stockType):
    if FreeCAD.GuiUp and obj.ViewObject:
        obj.addProperty('App::PropertyString', 'StockType', 'Stock', QtCore.QT_TRANSLATE_NOOP("PathStock", "Internal representation of stock type"))
        obj.StockType = stockType
        obj.setEditorMode('StockType', 2) # hide

        PathIconViewProvider.ViewProvider(obj.ViewObject, 'Stock')
        obj.ViewObject.Transparency = 90
        obj.ViewObject.DisplayMode = 'Wireframe'
コード例 #3
0
ファイル: PathJob.py プロジェクト: xartopaikths/FreeCAD
def createResourceClone(obj, orig, name, icon):
    clone = Draft.clone(orig)
    clone.Label = "%s-%s" % (name, orig.Label)
    clone.addProperty('App::PropertyString', 'PathResource')
    clone.PathResource = name
    if clone.ViewObject:
        PathIconViewProvider.ViewProvider(clone.ViewObject, icon)
        clone.ViewObject.Visibility = False
    return clone
コード例 #4
0
def createResourceClone(obj, orig, name, icon):
    clone = Draft.clone(orig)
    clone.Label = "%s-%s" % (name, orig.Label)
    clone.addProperty('App::PropertyString', 'PathResource')
    clone.PathResource = name
    if clone.ViewObject:
        PathIconViewProvider.ViewProvider(clone.ViewObject, icon)
        clone.ViewObject.Visibility = False
    obj.Document.recompute()  # necessary to create the clone shape
    return clone
コード例 #5
0
def SetupFixtureObject(obj, fixtureType):
    if FreeCAD.GuiUp and obj.ViewObject:
        obj.addProperty(
            'App::PropertyString', 'FixtureType', 'Fixture',
            QtCore.QT_TRANSLATE_NOOP(
                "PathFixture", "Internal representation of fixture type"))
        obj.FixtureType = fixtureType
        obj.setEditorMode('FixtureType', 2)  # hide

        PathIconViewProvider.ViewProvider(obj.ViewObject, 'Fixture')
        obj.ViewObject.Transparency = 0
        obj.ViewObject.DisplayMode = 'Flat Lines'
        obj.ViewObject.Selectable = False
        obj.ViewObject.Visibility = True
コード例 #6
0
ファイル: PathJob.py プロジェクト: Vaerks/SimpleCAM
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

    # Move clone to "positive" position
    bb = clone.Shape.BoundBox
    Draft.move(clone, FreeCAD.Vector(-bb.XMin + 2, -bb.YMin + 2, -bb.ZMin))
    if clone.ViewObject:
        PathIconViewProvider.ViewProvider(clone.ViewObject, icon)
        clone.ViewObject.Visibility = True
    obj.Document.recompute()  # necessary to create the clone shape
    return clone