Skip to main content
15-Moonstone
May 11, 2022
Question

Hololens 2 Illustrate sequence problems

  • May 11, 2022
  • 1 reply
  • 2123 views

Hello All,

 

I've been having problems while creating an experience for Hololens 2.

 

When I try to switch sequences using JS, the hololens wont change the sequence. I've added the PVI files of the sequences, that used to fix the problem, but not this time.

 

I've made a workaround by splitting the sequences to different models, but now i can't toggle the model visibility when a sequence is selected. The model opacity also cannot be changed when the sequence is selected. My workaround was to change the scale of the models to 0.01 to hide them, but this not a good solution.

 

Is there a proper fix for these bugs?

 

Best wishes

 

Alex

1 reply

21-Topaz I
May 11, 2022

Hi @AlexK ,

so depends what was the code what you use.

Is it working in preview mode but not working on HoloLens , or both?

I remember last time I used a code like this what was working

 

 

/////////////////////////////////////////
$scope.setSequenceList = function(){
//this parameter is linked to the sequence property of the model widget
 $scope.app.params['sequenceList'] = [
 {
 "display":"Figure 1",
 "value":"app/resources/Uploaded/l-Creo 3D - Figure 1.pvi"
 },
 {
 "display":"Figure 2",
 "value":"app/resources/Uploaded/l-Creo 3D - Figure 2.pvi"
 }
 ]
}
//------------------
$rootScope.$on('modelLoaded', function() { 
//on model load then set the sequence list
 $scope.setSequenceList();
 
timeout(()=> { 
$scope.app.playModelStep("Figure 1","model-1",3,true)},1000) //delay 

})

 

 

where the definition of playModelStep was something like this:

 

 

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

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


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

 $timeout(function () {
 
 $scope.$applyAsync(()=>{$scope.setWidgetProp(modelName, 'currentStep', parseInt(step_number));});
 
 if(play) //check if play should be applyed
 
 $timeout(function () {angular.element(document.getElementById(modelName)).scope().play(); }, 100);
 }, 500);
};
//////////////////////////////////

 

  

21-Topaz I
May 12, 2022

Hi Alex,

yes, so far I know, this should work , 

for example in the function example - second part - definition of ($scope.app.playModelStep() ) the last parameter "play" - when it is false - it will   set a sequence and step but will  it will not play the step. So that when you use a play button - means a button where the click event is bind to the play service of the model widget it should play the step as you already  set it with the function. I will check you example and will try to make it working. Thanks

AlexK15-MoonstoneAuthor
15-Moonstone
May 12, 2022

Hi Roland,

 

Thank you very much, I must have deleted the URL while copy pasting. The hiding problem is still an issue, but if i just unset the sequence before hiding it works, maybe the devs could look into that.

 

Best wishes,

Alex