Skip to main content
15-Moonstone
February 28, 2019
Solved

How can we show different steps in one sequence with different buttons?

  • February 28, 2019
  • 1 reply
  • 5331 views

I want to play each different step (Contain in one Sequence)  with different button. Please find reference image for clarification.

Best answer by RolandRaytchev

Yes , this is possible, but

as described in my previous post you need to have the list of sequences and steps.

- so 1.) you need to extract the info /the list  (how to do this , please, see my previous post)

2.) so when you have an info like sequence name, and step number (that what was extracted for example from PVI file)

You can set the particular sequence (if there are many) and set the step - via the step number (as mention by   ).. and play -- this we can do ... but , please, read more detailed all post's to this thread

Thanks

1 reply

17-Peridot
February 28, 2019

Hello Swapnil,

 

In this forum, I found this thread about the same question :

https://community.ptc.com/t5/Studio/Play-specific-step-of-PVI-sequence-at-studio/td-p/513858

 

It is possible to reuse the same javascript function but with a step parameter :

 

Be carreful, I didn' t check it and I am  sure if the step parameter is correctly copied to the function defined inside $timeout.

 

$scope.playSequence = function (step) 
{
 $scope.$applyAsync(()=>{angular.element(document.getElementById('model-1')).scope().reset();});

 //delay of .5 sec to be sure that all action are done
 $timeout(function (step) {
 $scope.$applyAsync(()=>{$scope.setWidgetProp('model-1', 'currentStep', step);});
 //further delay for a 0.5 sec to be sure that the step is set and then play
 $timeout(function () {$scope.$root.$broadcast('app.view["Home"].wdg["model-1"].svc.play'); }, 500);
 }, 500);
};

After that, it is possible to call this function in each button and use right step in the click event by:

playSequence(1);

 

Best regards,

Samuel

15-Moonstone
March 1, 2019

Hello, 
I tried this one but can i show steps in select widget, if i select dropdown i want all steps in that dropdown. 

Please find below image.


@sdidier wrote:

Hello Swapnil,

 

In this forum, I found this thread about the same question :

https://community.ptc.com/t5/Studio/Play-specific-step-of-PVI-sequence-at-studio/td-p/513858

 

It is possible to reuse the same javascript function but with a step parameter :

 

Be carreful, I didn' t check it and I am  sure if the step parameter is correctly copied to the function defined inside $timeout.

 

$scope.playSequence = function (step) 
{
 $scope.$applyAsync(()=>{angular.element(document.getElementById('model-1')).scope().reset();});

 //delay of .5 sec to be sure that all action are done
 $timeout(function (step) {
 $scope.$applyAsync(()=>{$scope.setWidgetProp('model-1', 'currentStep', step);});
 //further delay for a 0.5 sec to be sure that the step is set and then play
 $timeout(function () {$scope.$root.$broadcast('app.view["Home"].wdg["model-1"].svc.play'); }, 500);
 }, 500);
};

After that, it is possible to call this function in each button and use right step in the click event by:

playSequence(1);

 

Best regards,

Samuel


 

21-Topaz I
March 4, 2019

Hi @Swapnil_More ,

 

so far, I see you want to have list of all steps.

If you have such list is then is no problem ... but first you need to generate the list and there is no way to get it directly from the model widget.

Here more info about the problem in this post " Retrieve sequence stepname by index"

 

Also another way is to extract all steps is possible when you use the sequence definition file  -> from the *.pvi file . It is a xml format and using some tools/ public xml libraries you can easy  extract the properties  with name and value...

 

2019-03-04_10-06-31.gif