Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

The PTC Community email address has changed to Learn more.

Step by step play button


Step by step play button



I have created three figures in Creo model. Figure 1 has three steps. So I want to bind the steps with different buttons. Example, step-1 button have to play, step-1 sequence. Same way step 2 button have to play step-2 sequence.


How to do this.


@JA @si 


Hi @RK_9880418 ,

you can try  to use a javascript some definition like this

//definition of the function
$ = function (sequence,modelName,step_number,play) {
//sequnece -sequnece name e.g. TestFigure1 - as shown in UI
//modelName - model name e.g. model-1
//step_number - set this number to current step
//play   true/false execute play for the model

$scope.$applyAsync(()=>{$scope.setWidgetProp(modelName, 'sequence',  '');});

  $timeout(function () {
  $scope.$applyAsync(()=>{$scope.setWidgetProp(modelName, 'sequence',  'app/resources/Uploaded/l-Creo 3D - '+sequence +'.pvi');}); 

  $timeout(function () {
  $scope.$applyAsync(()=>{$scope.setWidgetProp(modelName, 'currentStep', parseInt(step_number));});
 if(play)   //check if play should be applyed
 $timeout(function () {angular.element(document.getElementById(modelName)).scope().play(); }, 100);
                      }, 500);


so you can play it  e.g. for  Figure 1 in model-1 widget and step 3 via the call 

$"Figure 1","model-1",3,true)


So can define a extra callback for each  step or use the statment directly in the UI




you need to bind 2 button with js

suppose for a Button 1 u need to bind it with model (Play all / play) and simultaneously need to right js code for sequence to play and similarly for button 2 also

With the code

$scope.playSpecificStep = function(step){
  $scope.view.wdg['model'].currentStep = step;
  $timeout(()=>"model", 'play'), 100)


For PlayButton1, Click JS: playSpecificStep(1)

For PlayButton2, Click JS: playSpecificStep(2)