Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hello Everyone,
I am developing an experience for hololens 2 where I need to take a picture using a voice command and the way I would like to do that is using the application events because I am using those for others functions.
In that way, I am trying to write a function and call it from the application event but no success so far.
Any idea on that?
Many thanks,
Felipe Duarte
Solved! Go to Solution.
Hi @fbdsilva ,
Is it possible for you to share the project, and maybe then i can look into it what's wrong or may be understand more clearly what you want to achieve
Also, as you mentioned, the issue is how to write the function to take the photo, you can use the below code
twx.app.fn.triggerWidgetService('camera-1', 'takePicture');
I Hope this helps, thanks
BR,
Mohit
Hello @fbdsilva ,
As far I can understand from this, you want to use application event to take picture and at the same time want to call a function
For this, you can do the below bindings:
Write the required function and call it as the way shown below :
Attaching a sample project for the same, let me know if this is what you were looking for
Best Regards,
Mohit Kabra
Hi Mohit,
Thanks for sending this but my issue is not how to write a function and call it from an application event, I am doing that for many others functions, the issue is how to write the function to take the photo because as you sent others type of functions works fine but a take picture event is not triggered from the application event.
Any ideas?
Thanks again,
Felipe Duarte
Hi @fbdsilva ,
Is it possible for you to share the project, and maybe then i can look into it what's wrong or may be understand more clearly what you want to achieve
Also, as you mentioned, the issue is how to write the function to take the photo, you can use the below code
twx.app.fn.triggerWidgetService('camera-1', 'takePicture');
I Hope this helps, thanks
BR,
Mohit
Hi Mohit,
Unfortunatelly I cannot share the project because there are customer CAD data on that. On the other hand I created a new one just to test the code you sent and it works there. I was using a different way to trigger the service.
Now I will fix my main project.
Also, just for people that can arrive on this topic with the same issue, I am attaching the project where it is working.
Many thanks Mohit!
Hello @fbdsilva, @Mohit_Kabra27,
I wanted to ask you, In my vuforia platform, application event is not showing. What should I do? Here I attach file please check this. Do you have any idea about this or anyone knows please tell me.
It is because you are not connected to any Thingworx server.