Ejemplo n.º 1
0
 def selectAction(self):
     if self.labTail:
         self.labTail.removeLabel()
         self.labTail = None
     self.L = frameCmd.getDistance()
     if self.L:
         self.form.edit1.setText("%.3f" % self.L)
     elif frameCmd.beams():
         beam = frameCmd.beams()[0]
         self.L = float(beam.Height)
         self.form.edit1.setText("%.3f" % self.L)
     else:
         self.form.edit1.setText('')
     self.form.slider.setValue(0)
     self.writeTail()
Ejemplo n.º 2
0
 def selectAction(self):
   if self.labTail:
     self.labTail.removeLabel()
     self.labTail=None
   self.L=frameCmd.getDistance()
   if self.L:
     self.form.edit1.setText("%.3f"%self.L)
   elif frameCmd.beams():
     beam=frameCmd.beams()[0]
     self.L=float(beam.Height)
     self.form.edit1.setText("%.3f"%self.L)
   else:
     self.form.edit1.setText('') 
   self.form.slider.setValue(0)
   self.writeTail()
Ejemplo n.º 3
0
 def accept(self):  # stretch
     if self.labTail:
         self.labTail.removeLabel()
         self.labTail = None
     self.L = frameCmd.getDistance()
     if self.form.edit1.text():
         length = float(self.form.edit1.text())
         FreeCAD.activeDocument().openTransaction('Stretch beam')
         for beam in frameCmd.beams():
             delta = float(beam.Height) - length
             frameCmd.stretchTheBeam(beam, length)
             if self.form.tail.isChecked():
                 disp = frameCmd.beamAx(beam).multiply(delta)
                 beam.Placement.move(disp)
             elif self.form.both.isChecked():
                 disp = frameCmd.beamAx(beam).multiply(delta / 2.0)
                 beam.Placement.move(disp)
         FreeCAD.activeDocument().recompute()
         FreeCAD.activeDocument().commitTransaction()
Ejemplo n.º 4
0
 def accept(self):
   if self.labTail:
     self.labTail.removeLabel()
     self.labTail=None
   self.L=frameCmd.getDistance()
   if self.form.edit1.text():
     length=float(self.form.edit1.text())
     FreeCAD.activeDocument().openTransaction('Stretch beam')
     for beam in frameCmd.beams():
       delta=float(beam.Height)-length
       frameCmd.stretchTheBeam(beam,length)
       if self.form.tail.isChecked():
         disp=frameCmd.beamAx(beam).multiply(delta)
         beam.Placement.move(disp)
       elif self.form.both.isChecked():
         disp=frameCmd.beamAx(beam).multiply(delta/2.0)
         beam.Placement.move(disp)
     FreeCAD.activeDocument().recompute()
     FreeCAD.activeDocument().commitTransaction()