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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

How to use the "click" event of a 3D label in ThingWorx Studio?

dsengupta-21
2-Explorer

How to use the "click" event of a 3D label in ThingWorx Studio?

Hi,

I want to show some labels which on clicking will show other labels. That means if there are two labels Label1 and Label2 then on clicking on Label1, Label2 will be visible. I have written a service which will update a Thing Property value to True/False based on the click. I have bind the Label1 click property to this service. Also the Thing property value is bind to the Label2.

But this is not working. Can anyone please tell me some way to achieve the task?

Thank you...

Regards,

Dipika

ACCEPTED SOLUTION

Accepted Solutions

Hi Dipika Sengupta​,

Is there any specific reason to write the service in ThingWorx.

You can directly add following code in ThingWorx Studio to make the 3D label widget visible:

$scope.view.wdg['3DLabel-2']['visible'] = true;

And call the function on click event of 3D label1.

I hope it helps.

View solution in original post

6 REPLIES 6

Hi Dipika Sengupta​,

Is there any specific reason to write the service in ThingWorx.

You can directly add following code in ThingWorx Studio to make the 3D label widget visible:

$scope.view.wdg['3DLabel-2']['visible'] = true;

And call the function on click event of 3D label1.

I hope it helps.

Hi Ankit Gupta

Thank you for the solution. It worked!!

I have another doubt. I have tried the same thing with model-items. I tried the click event of the model-item to show some 3d Label. It is working in the preview but not working while experiencing it from mobile device. Is there any work around?

Thank you...

Regards,

Dipika

Hi ankigupta,

 

can you help me how to call a function in the click event of the label please?

 

Thank you,

DF

if i paste this code into home.js the experience does not start. It just jumps back to the TWX view homescreen on hololens.

Hi,

I am having the same issue. in preview the event triggers when clicked but in a touchscreen device it does not. Is there any solution that would also work in ThingWorx View?

I managed to get this working. Just tested it once more and it worked.

Announcements

Top Tags