Skip to main content
1-Visitor
Jan 3, 2020 4:48 AM UTC
Solved

how to show the sequence on button rather than showing using squence list.

$scope.setSequenceList = function(){
$scope.app.params.sequencelist = [
{
"display":"FAN SERVICE",
"value":"app/resources/Uploaded/l-Creo 3D - FAN SERVICE.pvi"
}
,
{
"display":"FAN REPAIR",
"value":"app/resources/Uploaded/l-Creo 3D - FAN REPAIR.pvi"
}
,
{
"display":"HARNESS REPLACE",
"value":"app/resources/Uploaded/l-Creo 3D - HARNESS REPLACE.pvi"
}
]
}
$scope.setSequenceList();

$scope.selectSequence = function(){
console.log($scope.app);
if($scope.app.view.RepairSequence.wdg["sequence-select"].value){
$scope.app.view.RepairSequence.wdg["bottom-nav-grid"].visible = true;
$scope.app.view.RepairSequence.wdg["select-popup"].visible = false;
}
else {
$scope.app.view.RepairSequence.wdg["bottom-nav-grid"].visible = false;
$scope.app.view.RepairSequence.wdg["select-popup"].visible = true;
}}

 

This is the code i am using to show the sequence through sequnce select list.

Now i need to show each step on different button individually

15-Moonstone
Jan 3, 2020 11:49 AM UTC

Hello Manoj,

Please change model ID and Step number so you can use this code.

Please find below code and read it carefully so you can get my point.

$scope.sequence1 = function () {


$scope.$applyAsync(()=>{angular.element(document.getElementById('Model-ID')).scope().reset();});
//does not work synchronously
//delay of .5 sec to be sure that all action are done
$timeout(function () {
$scope.$applyAsync(()=>{$scope.setWidgetProp('model-1', 'currentStep', your_step_number);});
//further delay for a 0.5 sec to be sure that the step is set and then play
$timeout(function () {$scope.$root.$broadcast('app.view["Home"].wdg["model-1"].svc.play'); }, 500);
}, 500);
};

5 replies

15-Moonstone
Jan 3, 2020 5:52 AM UTC

Hello Manoj,

As per your question, you want to add each step/sequence on different button

so please find below code for same.

 Please change Model Id & Step No. for same.

$scope.sequence1 = function () {


$scope.$applyAsync(()=>{angular.element(document.getElementById('model-1')).scope().reset();});
//does not work synchronously
//delay of .5 sec to be sure that all action are done
$timeout(function () {
$scope.$applyAsync(()=>{$scope.setWidgetProp('model-1', 'currentStep', 2);});
//further delay for a 0.5 sec to be sure that the step is set and then play
$timeout(function () {$scope.$root.$broadcast('app.view["Home"].wdg["model-1"].svc.play'); }, 500);
}, 500);
};
Translate
1-Visitor
Jan 3, 2020 11:05 AM UTC

Hello Swapnil,

Thanks for replying.

there is an issue encountered ,using this code i have to place three different model and then show the three sequence.

I just want to place one model and then show the three sequence in three different buttons.

 

Regards

Manoj

Translate
15-Moonstone
Jan 3, 2020 11:49 AM UTC

Hello Manoj,

Please change model ID and Step number so you can use this code.

Please find below code and read it carefully so you can get my point.

$scope.sequence1 = function () {


$scope.$applyAsync(()=>{angular.element(document.getElementById('Model-ID')).scope().reset();});
//does not work synchronously
//delay of .5 sec to be sure that all action are done
$timeout(function () {
$scope.$applyAsync(()=>{$scope.setWidgetProp('model-1', 'currentStep', your_step_number);});
//further delay for a 0.5 sec to be sure that the step is set and then play
$timeout(function () {$scope.$root.$broadcast('app.view["Home"].wdg["model-1"].svc.play'); }, 500);
}, 500);
};
Translate