<?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 Example onMessage trigger to a user command and error in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/example-onmessage-trigger-to-a-user-command-and-error/m-p/13558038#M61201</link>
    <description>&lt;P&gt;&lt;I&gt;[ FlexSim 20.1.0 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hello All,&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Im trying to do a user command onMessage trigger but I cant find the proper parameters and the proper way to do it, looks like that dont work due once is reading the local variable is like the current is the model itself instead the specific object that im sending this(to Object).&lt;/P&gt;
 &lt;P&gt;Could you please send me a short example in order to understand better:&lt;/P&gt;
 &lt;P&gt;-Parameters&lt;/P&gt;
 &lt;P&gt;-Return Type&lt;/P&gt;
 &lt;P&gt;Please refer to the image that im triying to do and if you can let me know what is my mistake i really appreciate.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;In the first image i show how im calling the "userCommand" and how i create the parameters&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="27446-onmessage1.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1501844i20B29496B564449B/image-size/large?v=v2&amp;amp;px=999" role="button" title="27446-onmessage1.png" alt="27446-onmessage1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;second image show the variable the current like the "model" instead to the object that i need.&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="27452-onmessage2.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1501846iD2083A987F4C0E2C/image-size/large?v=v2&amp;amp;px=999" role="button" title="27452-onmessage2.png" alt="27452-onmessage2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;third image show the error that is making the system console.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="27461-onmessage3.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1501845iCBEA013B8A97CC4D/image-size/large?v=v2&amp;amp;px=999" role="button" title="27461-onmessage3.png" alt="27461-onmessage3.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;thanks a lot for the support.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Sat, 18 Apr 2020 03:24:49 GMT</pubDate>
    <dc:creator>raul_vazquez</dc:creator>
    <dc:date>2020-04-18T03:24:49Z</dc:date>
    <item>
      <title>Example onMessage trigger to a user command and error</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/example-onmessage-trigger-to-a-user-command-and-error/m-p/13558038#M61201</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 20.1.0 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hello All,&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Im trying to do a user command onMessage trigger but I cant find the proper parameters and the proper way to do it, looks like that dont work due once is reading the local variable is like the current is the model itself instead the specific object that im sending this(to Object).&lt;/P&gt;
 &lt;P&gt;Could you please send me a short example in order to understand better:&lt;/P&gt;
 &lt;P&gt;-Parameters&lt;/P&gt;
 &lt;P&gt;-Return Type&lt;/P&gt;
 &lt;P&gt;Please refer to the image that im triying to do and if you can let me know what is my mistake i really appreciate.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;In the first image i show how im calling the "userCommand" and how i create the parameters&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="27446-onmessage1.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1501844i20B29496B564449B/image-size/large?v=v2&amp;amp;px=999" role="button" title="27446-onmessage1.png" alt="27446-onmessage1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;second image show the variable the current like the "model" instead to the object that i need.&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="27452-onmessage2.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1501846iD2083A987F4C0E2C/image-size/large?v=v2&amp;amp;px=999" role="button" title="27452-onmessage2.png" alt="27452-onmessage2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;third image show the error that is making the system console.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="27461-onmessage3.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1501845iCBEA013B8A97CC4D/image-size/large?v=v2&amp;amp;px=999" role="button" title="27461-onmessage3.png" alt="27461-onmessage3.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;thanks a lot for the support.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 18 Apr 2020 03:24:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/example-onmessage-trigger-to-a-user-command-and-error/m-p/13558038#M61201</guid>
      <dc:creator>raul_vazquez</dc:creator>
      <dc:date>2020-04-18T03:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Example onMessage trigger to a user command and error</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/example-onmessage-trigger-to-a-user-command-and-error/m-p/13558039#M61202</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;The classic trigger approach works for current, because the node of the trigger is in the attributes tree of the object to find. Your user command is not in the object tree, it is in tools tree. And you find in the function header that current is declared by a function with c. c is a reference to the node of this code. The ownerobject is the object which contains the attribute tree. This leads to the object in the model. If you need the reference of current like the object, where you put your user command in, you must parse this parameter into your function call directly as a parameter. And you evaluate this parsed parameter with param(num number of order).&lt;/P&gt;&lt;P&gt;I think a return type is ONE type only. If you want to return a structure, you put the data into a node structure in the tree and you return a treenode reference to this structure parent node. Maybe there is already the possibility to return a variant. Then you would be able to return an array, which contains your structure. But it is still only one value of one type and in this case it would be Variant.&lt;/P&gt;&lt;P&gt;My personal remark on this endeavor. It is ambiguous to try to implement a complete functionality from start. Smaller steps of success are my favorite style to to begin with an endeavor.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 18 Apr 2020 09:58:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/example-onmessage-trigger-to-a-user-command-and-error/m-p/13558039#M61202</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2020-04-18T09:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Example onMessage trigger to a user command and error</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/example-onmessage-trigger-to-a-user-command-and-error/m-p/13558040#M61203</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;DIV class="fr-view clearfix"&gt;
  &lt;P&gt;Hi &lt;A rel="nofollow" href="https://answers.flexsim.com/users/461/joerg.v.html"&gt;Jörg&lt;/A&gt;, thanks for the feedback, Im using the user command in order to manage the code for multiple objects in the same user command instead of editing each object's message trigger separately. &lt;/P&gt;
  &lt;P&gt;I understood the tree concept and I changed so i changed easily due is the same object referenced to itselft and now I can do my logic many thanks, but I still having a lot of doubts in how to create it properly for example I didnt change the "return type" and the logic work so maybe is not the correct way to do it , do you have any example that I can take a look? or maybe some literature that I can take to learn please?&lt;/P&gt;
  &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="27482-1587232995436.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1501842iD4E63669692EDD72/image-size/large?v=v2&amp;amp;px=999" role="button" title="27482-1587232995436.png" alt="27482-1587232995436.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 18 Apr 2020 18:05:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/example-onmessage-trigger-to-a-user-command-and-error/m-p/13558040#M61203</guid>
      <dc:creator>raul_vazquez</dc:creator>
      <dc:date>2020-04-18T18:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Example onMessage trigger to a user command and error</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/example-onmessage-trigger-to-a-user-command-and-error/m-p/13558041#M61204</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;here is an example to parse several values of different datatypes into an array. Then I cast it directly into a Variant datatype to return only one value. The example transmitts the variables of the header declaration of the On Message trigger through a user command.&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/27519-mymessagecommand.fsm" target="_blank"&gt;myMessageCommand.fsm&lt;/A&gt; &lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 20 Apr 2020 19:45:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/example-onmessage-trigger-to-a-user-command-and-error/m-p/13558041#M61204</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2020-04-20T19:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Example onMessage trigger to a user command and error</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/example-onmessage-trigger-to-a-user-command-and-error/m-p/13558042#M61205</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Thanks a lot, is more clear....&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 Apr 2020 02:26:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/example-onmessage-trigger-to-a-user-command-and-error/m-p/13558042#M61205</guid>
      <dc:creator>raul_vazquez</dc:creator>
      <dc:date>2020-04-21T02:26:39Z</dc:date>
    </item>
  </channel>
</rss>

