I have made an animation command that changes a variable between 2 values, and updates the assembly at each step. The code is extremely trivial:
Code: Select all
def onRun(self):
# the selected variable
varName = self.varList.currentText()
begin = self.minValue.value()
end = self.maxValue.value()
step = self.stepValue.value()
varValue = begin
while varValue <= end:
setattr( self.Variables, varName, varValue )
App.ActiveDocument.Model.recompute('True')
Gui.updateGui()
varValue += step
return
Code: Select all
self.OKButton.clicked.connect(self.onRun)
Is there a way to use this Stop button to halt that while loop ?
self.StopButton.clicked.connect(self.onStop)