Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Hi, dear community!
Can I skip the sequence step from a list for example - step 3 was made accidentally in a sequence list and I do not want to change it in Creo Illustrate because I use one 3D sequence file with 10 figures-animations + I use 10 views (with Wayfinder waypoints on each view). If I change the sequence file in my Vuforia Studio I would need to correct or reconnect all my Waypoints for all 10 Views.- and I don't want to do it.
Please advise how I can skip the sequence step or how I can set up Wayfinder so it does not lose waypoints after reuploading(after the update) the 3D sequence file.
You could use some scripting to skip the step you don't want, something like this:
$scope.$on('newStep', function() {
// if this is the step to skip, bump up the step number to the next step
// for example, skip step 4 of sequence "Figure1"
if ($scope.getWidgetProp("model-1", "sequence").includes("Figure1")) {
if ($scope.getWidgetProp("model-1", "currentStep")==4) {
$scope.setWidgetProp("model-1", "currentStep", 5);
}
}
});
Hi, @ClayHelberg Thank you so much for your response!
I assume I am doing something wrong, because my step 3 (I want to skip) is still there, please advise.
This is my JS:
It's hard to try to debug code just by eyeballing it, but one thing that does jump out at me is this:
$scope.next=function(){
if ($scope.getWidgetProp("model-1", "sequence").includes("Remove Switch Board")) {
if ($scope.getWidgetProp("model-1", "currentStep")==2) {
$scope.setWidgetProp("model-1", "currentStep", 4);
}
}
// the part below overwrites the skip above
$scope.step=$scope.step+1;
$scope.view.wdg["model-1"].currentStep=$scope.step
}
The second part of this, where you increment $scope.step and then use it to set the model currentStep property, basically overwrites the bit above where you skip the step you want to skip.
One way to fix this would be to reverse the order of those code snippets, like this:
$scope.next=function(){
$scope.step=$scope.step+1;
$scope.view.wdg["model-1"].currentStep=$scope.step
}
if ($scope.getWidgetProp("model-1", "sequence").includes("Remove Switch Board")) {
if ($scope.getWidgetProp("model-1", "currentStep")==2) {
$scope.setWidgetProp("model-1", "currentStep", 4);
}
}
Hi @IB_10645210 ,
possibly when I join later to this discussion, I need first to mention that for me is not clear what means to skip a step.
Is it simple that your next button should skip the step or you need to skip steps when you do play all service (or some kind of service which is similar but customized to your requirement - let say yourPlayAllservice will execute (1,5, 7,8,9 12 steps)
IN all both cases you nee a list of the steps which should be played .
In this case you next button should simple look in the list and take the next specified step number .
So some JavaScript like this example for play step method could be used:
//////////////////////////////////
$scope.app.playModelStep = function (sequence,modelName,step_number,play) {
//sequence -sequnece name e.g. TestFigure1 - as shown in UI
//modelName - model name e.g. model-1 widget
//step_number - set this number to current step
//play true/false execute play for the model
$timeout(function () {
$scope.$applyAsync(()=>{$scope.setWidgetProp(modelName, 'sequence', '');});
},10);
$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)
//angular.element(document.getElementById(modelName)).scope().play(); }, 100);
}, 500);
};
//////////////////////////////////
the another approach that you need an continuous play so means that yourPlayAll service is called. In this case you need a little more complex construct. So the list could be read from the stepcompleted event and deponing on the next element in the list and what is the current number when step is completed we could call the next steps then:
//================================================================
$scope.$on('stepcompleted', function(evt, arg1, arg2, arg3) {
var parsedArg3 = JSON.parse(arg3);
console.log("stepcompleted event");
var labelId='step-complete-stepnumber'
$scope.setWidgetProp(labelId,"text",parsedArg3.stepNumber+"/"+parsedArg3.totalSteps);
labelId='step-complete-stepname'
$scope.setWidgetProp(labelId,"text",parsedArg3.stepName)
});