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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Label bindings

DFFHTW
6-Contributor

Label bindings

Hi,

 

I cannot bind a click event of a label to the visibility of another label (eyewear project).

 

Same with 3d images - why?

 

Is there a way to do this with json? If yes, can someone help me with the syntax? I'm not very familiar with coding.

 

Version: 8.2.2.3099

 

Thanks,

DF

 

2 REPLIES 2

Hi,

Here is my suggestion:

 

  • Edit the <<viewname>>.js file and paste the following code to create a function named OnLabelClick that will make the second label visible:

 

 

$scope.OnLabelClick = function() {
	$scope.view.wdg['3DLabel-2']['visible'] = true;
};

 

  • Replace '3DLabel-2' above with the Studio ID of you second label (the one you want to make visible) and press Save.
  • Select the First Label where you will fire the "Click" event
  • Under Events, press the JS button close the the "Click" event
  • Paste the following code that will execute the Function we've created:

 

OnLabelClick();

 

  • If the above works for you, you can change the function name (case sensitive) and change more than one label at a time by adding more changes to the function.

 

 

 

Good luck,

 

Ricardo

 

DFFHTW
6-Contributor
(To:rperdigao)

thank you very much! This helped a lot.

 

Is there a list anywhere with all available commands for the home.js like the $scope.view.wdg?

 

In specific, whats the command for starting the sequence of a model?

 

Thanks

DF

Top Tags