Skip to main content
12-Amethyst
December 30, 2016
Question

Display sequence step names from Creo Illustrate

  • December 30, 2016
  • 11 replies
  • 17997 views

This example briefly describes how you can use the Step names that you used in Creo Illustrate sequence definitions to drive a corresponding step instruction/description in your experience. This is an unsupported, preliminary solution - R&D is working on a better, final solution. But as long as this is not available, you can use this one for PoC and demo purposes.

To setup the scene: Here is what I meant with Step names that you used in Creo Illustrate:

StepDefInIllustarte.png

Now in Thingworx Studio you want to have the following result:

SequenceStepInView.png

The text is rendered with a simple Label widget. You'll have to remember the ID of this widget for the following javascript tweak. Add the following text to the Javascript section of your View:

var labelId = "label-1"; // ID of the Label widget that displays the Step progress and description  text

// this $on event handler switches the label based on the the sequence definition

// the arg variable is of the following form: (<step #>/<total step #) <step name>

$scope.$on('newStep', function(evt, arg) {

  $scope.setWidgetProp( labelId, "text", arg); // get the currentStep from the arg

});

Now you only need to provide the correct initial value in the Label widget text property and add control widgets (Buttons, Playback) to drive your animation and you're done.

Easy!

11 replies

1-Visitor
October 30, 2018

Hello All,

 

I have managed to get the step names visible in Studio.

But I have some of those containing special character s (i.e. "é", "á"). Those are not showing correctly in the Studio preview.

Illustrate exports them fine, as I can judge from the .xlf file.

 

How can I get the correct values in Studio?

 

Thanks 

18-Opal
April 11, 2019

I had the same problem, and I found encoding and decoding the string seems to do the trick:

 

$rootScope.$on("newStep", function(evt, arg) {
 var text = decodeURIComponent(escape(arg.match(/\d*\)\s*(.*)$/)[1]));
 console.log("newStep: setting steptext to " + text);
 $scope.stepText = text;
});
18-Opal
April 11, 2019

Wait, I take it back. I just discovered that this approach doesn't work on many devices. Back to the drawing board...