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

Play sequence by buttons

Vishnu_N
7-Bedrock

Play sequence by buttons

As per the original post

 

Hi Team, 

 

Once after extracting the .zip file i got the .pvi, .pvs,.ol file.

which file need to import whether .pvz file or extracting .zip files.

 

if i imported .pvz file i got 4 figures in sequence tab.

how to call these sequence with the button in home.js.

 

could you please explain about this. 

if you have any related project please attach here.

 

 

 

ACCEPTED SOLUTION

Accepted Solutions

Hi @Vishnu_N ,

so depening on your mobile device and kind of project - you do not need to extract the pvz file. Means that pvz file is a zip format what could be extracted with winzip compatible program. But mostly it will work to use the sequence without extracting 

So far I know in the past we had some issues where we needed to extract the pvz files. Acctualy  we can extract only the sequence - that what is a text file with .pvi extenstion e.g you have to copy them in the Upload folder or to supfolder

So in your case you have obviosly 4 pvi files inside  the pvz file. If you need to use only one of them then  you could extract only that one (.pvi) file to the Studio folder

To play the steps from a sequence you need to set the sequence property first and then you can play the step. If you want to do that with a script you can use some script like this:

//=============================
//default will not play automaticaly the steps
$scope.app.play=false
//that is the name test what is shown e.g. in the UI
//the ui will not display the full file name !!!
$scope.testUIDisplayName="test"
$scope.testtSequenceName="l-Creo 3D - "+$scope.testUIDisplayName
//=============================
$scope.setSequence = function(seq,play) {
$scope.app.play=play;
  $scope.setWidgetProp('model-1','sequence',"app/resources/Uploaded/smallengine3/"+seq+".pvi");
$scope.$applyAsync();
}
// listener which is started when the sequence loaded is completed
$scope.$on('sequenceloaded', function(evt, model, type, sequence) {
   if($scope.app.play)
    $timeout(() =>{
       try{
    $scope.app.fn.triggerWidgetService("model-1","play");
     } catch(ex){console.warn("ex="+ex);} 
               }
    ,500); //e.g. 0.5 second delay 
});
 
// then button function to test if that plays
$scope.myButtonTest()=>{$scope.setSequence($scope.testtSequenceName,true)}

 

 

View solution in original post

2 REPLIES 2

Hi @Vishnu_N ,

so depening on your mobile device and kind of project - you do not need to extract the pvz file. Means that pvz file is a zip format what could be extracted with winzip compatible program. But mostly it will work to use the sequence without extracting 

So far I know in the past we had some issues where we needed to extract the pvz files. Acctualy  we can extract only the sequence - that what is a text file with .pvi extenstion e.g you have to copy them in the Upload folder or to supfolder

So in your case you have obviosly 4 pvi files inside  the pvz file. If you need to use only one of them then  you could extract only that one (.pvi) file to the Studio folder

To play the steps from a sequence you need to set the sequence property first and then you can play the step. If you want to do that with a script you can use some script like this:

//=============================
//default will not play automaticaly the steps
$scope.app.play=false
//that is the name test what is shown e.g. in the UI
//the ui will not display the full file name !!!
$scope.testUIDisplayName="test"
$scope.testtSequenceName="l-Creo 3D - "+$scope.testUIDisplayName
//=============================
$scope.setSequence = function(seq,play) {
$scope.app.play=play;
  $scope.setWidgetProp('model-1','sequence',"app/resources/Uploaded/smallengine3/"+seq+".pvi");
$scope.$applyAsync();
}
// listener which is started when the sequence loaded is completed
$scope.$on('sequenceloaded', function(evt, model, type, sequence) {
   if($scope.app.play)
    $timeout(() =>{
       try{
    $scope.app.fn.triggerWidgetService("model-1","play");
     } catch(ex){console.warn("ex="+ex);} 
               }
    ,500); //e.g. 0.5 second delay 
});
 
// then button function to test if that plays
$scope.myButtonTest()=>{$scope.setSequence($scope.testtSequenceName,true)}

 

 

Announcements

Top Tags