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
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'
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
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
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
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