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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

how to stop a sequence in 3d eyewear

Milan_900
8-Gravel

how to stop a sequence in 3d eyewear

Hi everyone can you guys are tell how to stop and close a sequence by coding? In my project everything is good, except while I call a sequence in HoloLens that is working properly. I want to use a feature like stop and close its help to pause and close while we can change the sequence. Anyone can help?

 

 

 

4 REPLIES 4

One way which you could  try some thing like this

 

let WdgPanel = 'model-1';
$scope.app.fn.triggerWidgetService(WdgPanel,"stop"); 
$scope.$applyAsync();

 

when this is not sufficient you can try additional as next.

 

 
 $timeout( ()=> {         
    $scope.app.fn.triggerWidgetService(WdgPanel,"reset"); },50);

 

otherwise when the playing of the sequence will  not stop you can set  other step ,e.g. to 1, remove the src, sequence and always call subsequent $scope.$applyAsync()

skp.PNG

Thanks Roland for your support here add my project screenshot so  I want to say that while I am say the exploded then  its start the animation but in between that if I say close or stop it should be do that  but it does not .   because normally   its stop when the whole sequence done . i need code for this 

 

Hello @Milan_900 ,

thanks for the clarification, so understand. you want to stop the animation /sequence inside - like a video to pause and start again.

I do not think that this is possible, so far I remember some attempts I did in the past and I did not test in the current version but do not believe that there is a significant change. The sequence will stop but the display will stay to the start of the step or the next step not sure. 

One way I think could be possible -> is to split the animation to many sub steps e.g. 5 ( actually ordinary steps)

Possibly you could have different figures/sequences for each  splitable "Animation" so possibly 5 substeps.

Then when you call a new main step this will be an always calling of another sequence and playing all steps there (the sub steps of the animation).

Something like this:

 

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

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

   $timeout(function () {
  $scope.$applyAsync(()=>{$scope.setWidgetProp(modelName, 'src', 'app/resources/Uploaded/'+pvz +'.pvz');});     
  },50);
  

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


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

  $timeout(function () {  
  $scope.$applyAsync(()=>{$scope.setWidgetProp(modelName, 'currentStep', parseInt(step_number));});
 if(play)   //check if play should be applyed
 $timeout(function () {                                 $scope.app.fn.triggerWidgetService(modelName,"playAll");}, 350)
                      }
           , 500);


};

 

This code will set a model (possibly you can omit this ) and the sequence and with set to specific step (e.g. 1) and if play == true it will call play all  so will compete play all steps, so possibly you can stop this with stop on specific sub step. So going to next main step will be a calling of different figure /sequence. This could be a one possible workaround option what I see. No idea if there are another options for solution

to be sure that I did not overlooked something I reported to R&D team as enhancement and if possibly they could suggest some option I do not know. Ticket Jira VTS-1494

Top Tags