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

Sequences does not work on hololens using javascript

SOLVED
Aquamarine

Sequences does not work on hololens using javascript

I have created some sequences in creo illustrate 6.0 and have been using the following code to run them:

 

 

$scope.sodium = function () {

$scope.view.wdg['model-1']['sequence'] = "app/resources/Uploaded/l-Creo 3D - Figure 1.pvi";

angular.element(document.getElementById('model-1')).scope().play();

};


$scope.chlorine = function () {

$scope.view.wdg['model-1']['sequence'] = "app/resources/Uploaded/l-Creo 3D - Figure 3.pvi";

angular.element(document.getElementById('model-1')).scope().play();

}

This sequences actually run when i saw them in preview but does not work on hololens. Any idea why this is happening?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Sequences does not work on hololens using javascript

Hi @vivekse ,

is this only an JavaScript issue? Means does the problem occurs also  when you start playing the sequence e.g. via command or button / direct service and property binding or is only an issue with JavaScript

If this is an issue of JavaScript you can try something

 

 

 

//list with some sequneces
var figure_list =["l-Creo 3D - TestFigure1","l-Creo 3D - SecondTestFigure"];
/////
$scope.app.setSequence = function(val)
{  console.log(" called app.setSequnece("+ (val-1)+")=app/resources/Uploaded/"+figure_list[val-1]+".pvi")
    try{$scope.setWidgetProp('model-1', 'sequence', "app/resources/Uploaded/"+figure_list[val-1]+".pvi"); 
$timeout( function() {twx.app.fn.triggerWidgetService('model-1', 'play');},500);

}catch(e) {console.warn("exception="+e);}
	  $scope.$applyAsync();
    };
 /////////////////////////// called on start
$scope.app.test=function () {

   ////////////////
            $timeout( function() {$scope.app.setSequence(1);}  , 500);
            $scope.$applyAsync();
            
            $timeout( function() { $scope.app.setSequence(2); }, 11000);
         $timeout( function() { $scope.app.setSequence(3); }, 30000);
           
   
        $timeout( function() {twx.app.fn.triggerWidgetService("model-1", 'reset'); 
                           $scope.$applyAsync();  console.log("reset-4");             
                                                            }, 20000);   
} //end of test

//////////////////////////////////
 $rootScope.$on('modelLoaded', function()  
                { $scope.app.test();      
          
                });

 

 

 

Here the code is called in the modelLoaded event

View solution in original post

3 REPLIES 3
Highlighted

Re: Sequences does not work on hololens using javascript

Hi @vivekse ,

is this only an JavaScript issue? Means does the problem occurs also  when you start playing the sequence e.g. via command or button / direct service and property binding or is only an issue with JavaScript

If this is an issue of JavaScript you can try something

 

 

 

//list with some sequneces
var figure_list =["l-Creo 3D - TestFigure1","l-Creo 3D - SecondTestFigure"];
/////
$scope.app.setSequence = function(val)
{  console.log(" called app.setSequnece("+ (val-1)+")=app/resources/Uploaded/"+figure_list[val-1]+".pvi")
    try{$scope.setWidgetProp('model-1', 'sequence', "app/resources/Uploaded/"+figure_list[val-1]+".pvi"); 
$timeout( function() {twx.app.fn.triggerWidgetService('model-1', 'play');},500);

}catch(e) {console.warn("exception="+e);}
	  $scope.$applyAsync();
    };
 /////////////////////////// called on start
$scope.app.test=function () {

   ////////////////
            $timeout( function() {$scope.app.setSequence(1);}  , 500);
            $scope.$applyAsync();
            
            $timeout( function() { $scope.app.setSequence(2); }, 11000);
         $timeout( function() { $scope.app.setSequence(3); }, 30000);
           
   
        $timeout( function() {twx.app.fn.triggerWidgetService("model-1", 'reset'); 
                           $scope.$applyAsync();  console.log("reset-4");             
                                                            }, 20000);   
} //end of test

//////////////////////////////////
 $rootScope.$on('modelLoaded', function()  
                { $scope.app.test();      
          
                });

 

 

 

Here the code is called in the modelLoaded event

View solution in original post

Highlighted

Re: Sequences does not work on hololens using javascript

@RolandRaytchev Thank you for reply but when i directly bind it with the application events it works but not with javascript.

Highlighted

Re: Sequences does not work on hololens using javascript

Hi @vivekse ,

if this is working on the HoloLens with direct binding , for this I suggested the code. Because if it will not work generally the code will not help anyways.

Did you check if you use this constuct if it work. When the direct binding is working it should work defintely in JS.

 

Announcements
Topics available:
AR/VR for Data Optimization AR/VR for Security and Control AR/VR for Inspection