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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Interact with a widget in a specific step in a certain sequence

BD_9702161
3-Visitor

Interact with a widget in a specific step in a certain sequence

Hi All,

 

I usually use the following code for making appear and disappear the widgets in a specific step in sequence:

 

$scope.$on('newStep', function() {
 
   switch($scope.view.wdg['model-3']['currentStep']) {

      case 3:
         $scope.setWidgetProp( "Warning", "text", 'Note: Only for T200 & T600 Series');
         break;
   }
});


However, this time in model-3 I have three different sequences and not just one. With this code, the widgets appear in all the sequences. What can I add to specify the sequence?

Thank you!

3 REPLIES 3

May be you can try some thing like:

 

 

$scope.$on('newStep', function() {
 if($scope.view.wdg['model-3']['sequence'] == 'app/resources/Uploaded/l-Creo 3D - fig_5F1.pvi') 
//go to switch construct  only if model wdiget has sequence fig_5F1 
   switch($scope.view.wdg['model-3']['currentStep']) {

      case 3:
         $scope.setWidgetProp( "Warning", "text", 'Note: Only for T200 & T600 Series');
         break;
   }
});

 

 

So means you will execute the switch statement only if the model widget sequence property == fig_5F1

for the compression statement , may be , is better to compare only a string is practically contained by the sequence

something like e.g. using indexOf  like:

 if($scope.view.wdg['model-3']['sequence'].indexOf("Figure 1") != -1) 
 //go to switch construct  only if model wdiget has sequence Figure 1
   switch($scope.view.wdg['model-3']['currentStep']) {
   ....

 

Thank you so much! It worked great!

 

Top Tags