Skip to main content
1-Visitor
January 20, 2021
Solved

Play a specific step of a sequence

  • January 20, 2021
  • 1 reply
  • 2257 views

I have a number of steps in a sequence and I would like to trigger one particular step only without playing the whole sequence from the beginning. For instance, play step 4 directly by clicking a button. 

Best answer by dsgnrClarK

Hi, @Ace_Rothstein_315546 

That's say we have 'model-1' ready and a Sequence selected.

With code in home.js:

$scope.playSpecificStep = function(num){
 $scope.view.wdg['model-1'].currentStep = num;
 $timeout(function() {
 $scope.$broadcast('app.view["model-1"].svc.play')
 }, 200)
}

Specific step could be played with Widget\ Events\ JS Expression like below

playSpecificStep(3); // play step 3
playSpecificStep(7); // play step 7

 

regards,

ClarK

1 reply

16-Pearl
January 21, 2021

Hi, @Ace_Rothstein_315546 

That's say we have 'model-1' ready and a Sequence selected.

With code in home.js:

$scope.playSpecificStep = function(num){
 $scope.view.wdg['model-1'].currentStep = num;
 $timeout(function() {
 $scope.$broadcast('app.view["model-1"].svc.play')
 }, 200)
}

Specific step could be played with Widget\ Events\ JS Expression like below

playSpecificStep(3); // play step 3
playSpecificStep(7); // play step 7

 

regards,

ClarK

1-Visitor
January 21, 2021

Thank you @dsgnrClarK. It works great! Just what I was looking for. However, what if I had multiple sequences/ figures?

16-Pearl
January 21, 2021

Hi, @Ace_Rothstein_315546 

 

You can use the code below to assign sequence

 

 

$scope.view.wdg['model-1'].sequence = 'l-Creo 3D - figure.pvi';

 

Nevertheless, after switching sequence, Playback starts from 1.

And I don't know how to switch sequence and jump step at the same time.