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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

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

dsengupta-21
2-Explorer

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
katte
12-Amethyst
(To:dsengupta-21)

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

Hi giri

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

Regards,

Dipika

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.

Announcements

Top Tags