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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Add text to AR steps, in popup window

svlaminck
9-Granite

Add text to AR steps, in popup window

Hello everyone,

I am trying to add some instruction text in a popup label, i have found some solutions here on the conumity, like showing the stepname, and that is working, however some of my instructions contain 2 lines of text.

Replacing the stepname by step_description is not working.

Note: I am new to coding, and have no experience. 

 

Does anyone already done this and can share me some code?

 

This is what i have now:

var labelId = "label-1";
$scope.$on('newStep', function(evt, arg) {

$scope.setWidgetProp( labelId, "text", arg); // get the currentStep from the arg
var labelText = $scope.view.wdg['label-1'].text;
var InstructText = step_description
$scope.setWidgetProp( "label-1", "text", InstructText);
});

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi, not sure if you still need the solution, but here is one for reference. In this example I use 2 buttons (play and rewind). Code sample:

 

$scope.hideStepDesc = function() { //this function hideStepDesc(); is also added to my rewind button, to hide label after rewinding 
$scope.view.wdg['label-1'].visible = false;  
}


$scope.showStepDesc = function() { 
var stepNo = $scope.view.wdg['model-1'].currentStep; // model-1 is my model Studio ID

$scope.view.wdg['label-1'].visible = true; // this function showStepDesc(); is assigned to my play button


if (stepNo == 1){
$scope.view.wdg['label-1'].text = '1. This is your step 1 description'
}

if (stepNo == 2){
$scope.view.wdg['label-1'].text = '2. This is step 2 description'
}
//and here you can add as many steps as you need before your function is over
}

 

View solution in original post

2 REPLIES 2

Kick up

Hi, not sure if you still need the solution, but here is one for reference. In this example I use 2 buttons (play and rewind). Code sample:

 

$scope.hideStepDesc = function() { //this function hideStepDesc(); is also added to my rewind button, to hide label after rewinding 
$scope.view.wdg['label-1'].visible = false;  
}


$scope.showStepDesc = function() { 
var stepNo = $scope.view.wdg['model-1'].currentStep; // model-1 is my model Studio ID

$scope.view.wdg['label-1'].visible = true; // this function showStepDesc(); is assigned to my play button


if (stepNo == 1){
$scope.view.wdg['label-1'].text = '1. This is your step 1 description'
}

if (stepNo == 2){
$scope.view.wdg['label-1'].text = '2. This is step 2 description'
}
//and here you can add as many steps as you need before your function is over
}

 

Top Tags