<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Tutorials using the command sendToWebEngine are missing a vital detail in VRED Forum</title>
    <link>https://forums.autodesk.com/t5/vred-forum/tutorials-using-the-command-sendtowebengine-are-missing-a-vital/m-p/9198779#M4875</link>
    <description>&lt;P&gt;There are a lot of great samples how to use HTML5 with VRED.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately none of them shows how to access the &lt;STRONG&gt;data&lt;/STRONG&gt; parameter of the following python code in JavaScript&lt;/P&gt;&lt;PRE&gt;sendToWebEngine( name, event, data )&lt;/PRE&gt;&lt;P&gt;VRED uses a so called CustomEvent to talk to the WebEngine. I was successfully accessing the &lt;STRONG&gt;data&lt;/STRONG&gt; parameter from python as the &lt;STRONG&gt;.detail&lt;/STRONG&gt; member of the JavaScript event like this:&lt;/P&gt;&lt;PRE&gt;  document.addEventListener("SET_TEXT1", function(evt) {
    document.getElementById("hudText1").innerText = evt.detail;
  });&lt;/PRE&gt;</description>
    <pubDate>Thu, 12 Dec 2019 14:36:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-12-12T14:36:16Z</dc:date>
    <item>
      <title>Tutorials using the command sendToWebEngine are missing a vital detail</title>
      <link>https://forums.autodesk.com/t5/vred-forum/tutorials-using-the-command-sendtowebengine-are-missing-a-vital/m-p/9198779#M4875</link>
      <description>&lt;P&gt;There are a lot of great samples how to use HTML5 with VRED.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately none of them shows how to access the &lt;STRONG&gt;data&lt;/STRONG&gt; parameter of the following python code in JavaScript&lt;/P&gt;&lt;PRE&gt;sendToWebEngine( name, event, data )&lt;/PRE&gt;&lt;P&gt;VRED uses a so called CustomEvent to talk to the WebEngine. I was successfully accessing the &lt;STRONG&gt;data&lt;/STRONG&gt; parameter from python as the &lt;STRONG&gt;.detail&lt;/STRONG&gt; member of the JavaScript event like this:&lt;/P&gt;&lt;PRE&gt;  document.addEventListener("SET_TEXT1", function(evt) {
    document.getElementById("hudText1").innerText = evt.detail;
  });&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Dec 2019 14:36:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/tutorials-using-the-command-sendtowebengine-are-missing-a-vital/m-p/9198779#M4875</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-12T14:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Tutorials using the command sendToWebEngine are missing a vital detail</title>
      <link>https://forums.autodesk.com/t5/vred-forum/tutorials-using-the-command-sendtowebengine-are-missing-a-vital/m-p/9514034#M4876</link>
      <description>&lt;P&gt;Hello, I'm trying to display the data parameter on my browser.&lt;/P&gt;&lt;P&gt;I tried this but it did not work.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;	sendToWebEngine("SizeValue", "ValueX", str(XValue))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;SIZE&amp;lt;/h1&amp;gt;
    &amp;lt;script&amp;gt;
    document.addEventListener("ValueX", function(evt) {
            ValueX= document.getElementById("XValue").innerText = evt.detail;
            });
            
         document.write(ValueX);
    &amp;lt;/script&amp;gt; 

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 13 May 2020 20:06:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/tutorials-using-the-command-sendtowebengine-are-missing-a-vital/m-p/9514034#M4876</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-13T20:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Tutorials using the command sendToWebEngine are missing a vital detail</title>
      <link>https://forums.autodesk.com/t5/vred-forum/tutorials-using-the-command-sendtowebengine-are-missing-a-vital/m-p/9517834#M4877</link>
      <description>&lt;P&gt;Dear &lt;SPAN class="UserName lia-user-name lia-user-rank-Explorer lia-component-message-view-widget-author-username"&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8897142" target="_self"&gt;&lt;SPAN class=""&gt;Ayoub,&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-Explorer lia-component-message-view-widget-author-username"&gt;&lt;SPAN class=""&gt;your attempt is wrong in many levels. Let me try to both give you running code for your use case and also explain how it works.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="UserName lia-user-name lia-user-rank-Explorer lia-component-message-view-widget-author-username"&gt;&lt;SPAN class=""&gt;Python side needs to look like this:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sendToWebEngine(nameOfEngine, "SET_SIZE", "x="+str(xSize)+", y="+str(ySize))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTML side should look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;SIZE&amp;lt;/h1&amp;gt;
    &amp;lt;span id="sizeValue"&amp;gt;to be replaced by event listener&amp;lt;/span&amp;gt;
    &amp;lt;script&amp;gt;
    document.addEventListener("SET_SIZE", function(evt) {
       document.getElementById("sizeValue").innerText = evt.detail;
    });
    &amp;lt;/script&amp;gt; 
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 05:19:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/tutorials-using-the-command-sendtowebengine-are-missing-a-vital/m-p/9517834#M4877</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-15T05:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Tutorials using the command sendToWebEngine are missing a vital detail</title>
      <link>https://forums.autodesk.com/t5/vred-forum/tutorials-using-the-command-sendtowebengine-are-missing-a-vital/m-p/9528815#M4878</link>
      <description>&lt;P&gt;Hello, thank you for the answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 08:57:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/tutorials-using-the-command-sendtowebengine-are-missing-a-vital/m-p/9528815#M4878</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-05-20T08:57:56Z</dc:date>
    </item>
  </channel>
</rss>

