def accept(self, ang=None): if not ang: ang = float(self.form.edit1.text()) self.deleteArrow() objects = FreeCADGui.Selection.getSelection() if objects and self.Axis: FreeCAD.ActiveDocument.openTransaction('rotateTheBeamAround') for o in objects: if self.form.copyCB.isChecked(): FreeCAD.activeDocument().copyObject(o, True) frameCmd.rotateTheBeamAround(o, self.Axis, ang) FreeCAD.ActiveDocument.commitTransaction()
def accept(self, ang=None): if not ang: ang=float(self.form.edit1.text()) self.deleteArrow() objects=FreeCADGui.Selection.getSelection() if objects and self.Axis: FreeCAD.ActiveDocument.openTransaction('rotateTheBeamAround') for o in objects: if self.form.copyCB.isChecked(): FreeCAD.activeDocument().copyObject(o,True) frameCmd.rotateTheBeamAround(o,self.Axis,ang) FreeCAD.ActiveDocument.commitTransaction()
def pickAction(self,path=None,event=None,arg=None): FreeCAD.activeDocument().openTransaction('Quick move') if event.wasCtrlDown(): k=-1*float(self.edit.text()) else: k=1*float(self.edit.text()) sel=FreeCADGui.Selection.getSelection() if sel: self.objs=[o for o in sel if hasattr(o,'Shape')] if event.wasCtrlDown() and event.wasAltDown(): if frameCmd.edges(): self.edge=frameCmd.edges()[0] for o in self.objs: frameCmd.rotateTheBeamAround(o, self.edge, 90) elif self.edge: for o in self.objs: frameCmd.rotateTheBeamAround(o, self.edge, 90) else: for o in self.objs: o.Placement.move(self.direct*k) self.Placement.move(self.direct*k) pl,direct,M=[self.Placement,self.direct,self.scale] self.closeArrow() self.__init__(self.edit, pl,direct,M,self.objs) FreeCAD.activeDocument().commitTransaction()
def pickAction(self,path=None,event=None,arg=None): FreeCAD.activeDocument().openTransaction('Quick move') if event.wasCtrlDown(): k=-1 else: k=1 sel=FreeCADGui.Selection.getSelection() if sel: self.objs=[o for o in sel if hasattr(o,'Shape')] if event.wasCtrlDown() and event.wasAltDown(): if frameCmd.edges(): self.edge=frameCmd.edges()[0] for o in self.objs: frameCmd.rotateTheBeamAround(o, self.edge, 90) elif self.edge: for o in self.objs: frameCmd.rotateTheBeamAround(o, self.edge, 90) else: for o in self.objs: o.Placement.move(self.direct*k) self.Placement.move(self.direct*k) pl,direct,M=[self.Placement,self.direct,self.scale] self.closeArrow() self.__init__(pl,direct,M,self.objs) FreeCAD.activeDocument().commitTransaction()