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

Play more than one sequence on one model based on some conditions in ThingWorx Studio.

Highlighted

Play more than one sequence on one model based on some conditions in ThingWorx Studio.

I have different pvi files created which I have extracted from different pvz files. I have one button whose text value keeps on updating. Now I want make an experience, depending on the value of the button text, n clicking the button different sequence should be played.

Currently I amusing the following code. But it's not working...

$scope.buttonPlay = function() {

  if($scope.app.mdl['Car1'].properties['Part']=="Part1") {

  setWidgetProp( 'model-1', 'sequence', 'Part1.pvi');

  }

if($scope.app.mdl['Car1'].properties['Part']=="Part") {

  setWidgetProp( 'model-1', 'sequence', 'Part.pvi');

  }

}

Please suggest some way to achieve the task.

Thank you...

Regards,

Dipika

3 REPLIES 3

Re: Play more than one sequence on one model based on some conditions in ThingWorx Studio.

updating the properties of widgets should include " $scope.view.wdg['widgetID']......." Let me know if that didn't work.

Re: Play more than one sequence on one model based on some conditions in ThingWorx Studio.

Hi giri

Thank you for your reply. I have tried the solution. But it's not working.

Regards,

Dipika

Re: Play more than one sequence on one model based on some conditions in ThingWorx Studio.

try this

$scope.playseq = function(seqname) {

  var modelEle1 = angular.element(document.getElementById('model-1'));

  $scope.view.wdg['model-1']['sequence'] = seqname;

  $timeout(function() {modelEle1.scope().playAll();},100);

  $scope.$applyAsync();

}

call it with the sequence name; it will set the sequence value and the a short time later will kick off the player.