def addElement(self): if self.obj: added = False for o in FreeCADGui.Selection.getSelection(): if o != self.obj: ArchComponent.addToComponent(self.obj,o,"Objects") added = True if added: self.update() else: FreeCAD.Console.PrintWarning("Please select objects in the 3D view or in the model tree before pressing the button\n")
def addElement(self): it = self.tree.currentItem() if it: mod = None for a in self.attribs: if it.text(0) == getattr(self, "tree" + a).text(0): mod = a if mod == "Machinings": print("TODO : Add Machinings") else: for o in FreeCADGui.Selection.getSelection(): ArchComponent.addToComponent(self.obj, o, mod) self.update()
def addElement(self): it = self.tree.currentItem() if it: mod = None for a in self.attribs: if it.text(0) == getattr(self,"tree"+a).text(0): mod = a if mod == "Machinings": print "TODO : Add Machinings" else : for o in FreeCADGui.Selection.getSelection(): ArchComponent.addToComponent(self.obj,o,mod) self.update()
def __init__(self,obj): ArchComponent.Component.__init__(self,obj) obj.addProperty("App::PropertyLength","Length","1Timber","The length of this element.") obj.addProperty("App::PropertyLength","Width","1Timber","The width of this element.") obj.addProperty("App::PropertyLength","Height","1Timber","The height of this element.") obj.addProperty("App::PropertyEnumeration","Preset","1Timber","Preset parameters for this beam") obj.Preset = TimberComponent.getPresetsList() #obj.addProperty("App::PropertyLinkList","Armatures","Arch","Armatures contained in this element") #obj.addProperty("App::PropertyVector","Normal","Arch","The normal extrusion direction of this object (keep (0,0,0) for automatic normal)") #obj.addProperty("App::PropertyVectorList","Nodes","Arch","The structural nodes of this element") #obj.addProperty("App::PropertyString","Profile","Arch","A description of the standard profile this element is based upon") self.Type = "TBeam" obj.Role = Roles structure = Arch.makeStructure() #structure.setEditorMode("Width", 1) #structure.setEditorMode("Height", 1) #structure.setEditorMode("Length", 1) #structure.setEditorMode("Placement", 1) structure.MoveWithHost = True ArchComponent.addToComponent( obj , structure , "Base" )
def __init__(self, obj): ArchComponent.Component.__init__(self, obj) obj.addProperty("App::PropertyLength", "Length", "1Timber", "The length of this element.") obj.addProperty("App::PropertyLength", "Width", "1Timber", "The width of this element.") obj.addProperty("App::PropertyLength", "Height", "1Timber", "The height of this element.") obj.addProperty("App::PropertyEnumeration", "Preset", "1Timber", "Preset parameters for this beam") obj.Preset = TimberComponent.getPresetsList() #obj.addProperty("App::PropertyLinkList","Armatures","Arch","Armatures contained in this element") #obj.addProperty("App::PropertyVector","Normal","Arch","The normal extrusion direction of this object (keep (0,0,0) for automatic normal)") #obj.addProperty("App::PropertyVectorList","Nodes","Arch","The structural nodes of this element") #obj.addProperty("App::PropertyString","Profile","Arch","A description of the standard profile this element is based upon") self.Type = "TBeam" obj.Role = Roles structure = Arch.makeStructure() #structure.setEditorMode("Width", 1) #structure.setEditorMode("Height", 1) #structure.setEditorMode("Length", 1) #structure.setEditorMode("Placement", 1) structure.MoveWithHost = True ArchComponent.addToComponent(obj, structure, "Base")
def addElement(self): if self.obj: for o in FreeCADGui.Selection.getSelection(): ArchComponent.addToComponent(self.obj,o,"Objects") self.update()
def addElement(self): if self.obj: for o in FreeCADGui.Selection.getSelection(): ArchComponent.addToComponent(self.obj, o, "Objects") self.update()