Wrong CurrentStep after rewind
Hi everyone,
i want to click through a step-by-step animation made in creo. For each step i want to display another text.
I have a button attached to "play" and a button to "rewind".
Each Button calls a function, where the code reads the current step and then sets the text according to the value of current step. For just going forward with the play button, everything works just fine. Only when the rewind button is pressed, the value of CurrentStep is wrong.
Do you have any suggestions? Thanks!
Here is my Code:
$scope.app.fn.loadResourceScript("Uploaded/fn.js");
$scope.btnVisible = function(step){
if(step < 4 && step > 0){
$scope.show("button-next");
$scope.show("button-back");
}
if(step == 0){
$scope.hide("button-back");
}
if(step == 4){
$scope.hide("button-next");
}
}
$scope.setText = function(step){
switch(step){
case 0:
$scope.changeProperty("text_info_2","text","0text hier einfügen ala code");
break;
case 1:
$scope.changeProperty("text_info_2","text","1text hier einfügen ala code");
break;
case 2:
$scope.changeProperty("text_info_2","text","2text hier einfügen ala code");
break;
case 3:
$scope.changeProperty("text_info_2","text","3text hier einfügen ala code");
break;
case 4:
$scope.changeProperty("text_info_2","text","4text hier einfügen ala code");
break;
default:
$scope.changeProperty("text_info_2","text","def text hier einfügen ala code");
break;
}
}
$scope.$on("modelLoaded", () =>
{
$scope.setText(0);
$scope.btnVisible(0);
}
)
$scope.buttonNext = function(){
let currentStep = $scope.getCurrentStep("SolarTracker");
$scope.btnVisible(currentStep);
$scope.setText(currentStep);
}
$scope.buttonBack = function(){
let currentStep = $scope.getCurrentStep("SolarTracker");
//$scope.btnVisible($scope.getPreviousStep("SolarTracker"));
$scope.changeProperty("text_info_2","text", currentStep);
//$scope.setText($scope.getCurrentStep("SolarTracker"));
}

