Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
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?
Solved! Go to Solution.
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
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
@RolandRaytchev Thank you for reply but when i directly bind it with the application events it works but not with 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.