<?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 Re: Bind NodeListArray from within SDT class in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/bind-nodelistarray-from-within-sdt-class/m-p/13546531#M52136</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;
 Nevermind, I figured it out. I was creating an instance of my SDT, then adding to its NodeListArray, then adding to the tree. 
 &lt;P&gt;I fixed it by creating the instance, &lt;EM&gt;immediately &lt;/EM&gt;adding it to the tree, and &lt;EM&gt;then&lt;/EM&gt; manipulating the NodeListArray.&lt;/P&gt;
 &lt;P&gt;Thanks again for your help. &lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Mon, 13 Feb 2023 19:11:44 GMT</pubDate>
    <dc:creator>thomas_smithWKC4J</dc:creator>
    <dc:date>2023-02-13T19:11:44Z</dc:date>
    <item>
      <title>Bind NodeListArray from within SDT class</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/bind-nodelistarray-from-within-sdt-class/m-p/13546528#M52133</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 23.0.1 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;I can't figure out how to bind a NodeListArray for an SDT derivative.&lt;/P&gt;
 &lt;P&gt;For ODT, this is how I would do it for a list of SDTs:&lt;/P&gt;
 &lt;PRE&gt;class MyODTType: public ObjectDataType
{
   NodeListArray&amp;lt;MySDTType&amp;gt;::SdtSubNodeBindingType mylistofSDTs;
   
   void MyODTType::bindVariables() 
   {
      ObjectDataType::bindVariables();
      bindVariable(variable); // &amp;lt;---
   }
};&lt;/PRE&gt;
 &lt;P&gt;My SDTs also need to have a list of treenodes within them. Which bind macro do I use in this example? &lt;/P&gt;
 &lt;PRE&gt;class MySDTType: public SimpleDataType
{
   NodeListArray&amp;lt;treenode&amp;gt;::NodePtrType mylistofnodes;
   
   void MySDTType::bind() 
   { 
      SimpleDataType::bind();
      // What goes here? 
      // I have tried with no success:
      // bindNodeListArrayAsClass(treenode, mylistofnodes);
   }
};&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sun, 12 Feb 2023 01:54:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/bind-nodelistarray-from-within-sdt-class/m-p/13546528#M52133</guid>
      <dc:creator>thomas_smithWKC4J</dc:creator>
      <dc:date>2023-02-12T01:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Bind NodeListArray from within SDT class</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/bind-nodelistarray-from-within-sdt-class/m-p/13546529#M52134</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;To bind a NodeListArray variable in a SimpleDataType, use bindSubNode:&lt;/P&gt;&lt;PRE&gt;bindSubNode(someNodeListArray, 0)&lt;/PRE&gt;&lt;P&gt;Basically, since the NodeListArray needs a parent node to place all its list elements under, it can be treated as a node in bindSubNode().&lt;/P&gt;&lt;P&gt;The bindClass() methods/macros deal with adding a new FlexScript API class, rather than binding member variables of a class. For more information, see:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.flexsim.com/en/23.0/Reference/DeveloperAdvancedUser/ModuleSDK/ExtendingFlexScript/ExtendingFlexScript.html#class"&gt;https://docs.flexsim.com/en/23.0/Reference/DeveloperAdvancedUser/ModuleSDK/ExtendingFlexScript/ExtendingFlexScript.html#class&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There is an example module file available on that page you might find helpful.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 13 Feb 2023 15:41:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/bind-nodelistarray-from-within-sdt-class/m-p/13546529#M52134</guid>
      <dc:creator>JordanLJohnson</dc:creator>
      <dc:date>2023-02-13T15:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Bind NodeListArray from within SDT class</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/bind-nodelistarray-from-within-sdt-class/m-p/13546530#M52135</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hi Jordan. This works for binding the NodeListArray, but when I try to add elements to it I am getting an exception.&lt;/P&gt;
 &lt;PRE&gt;NodeListArray&amp;lt;treenode&amp;gt;::NodePtrType mylistofnodes;
...
bindSubNode(mylistofnodes, 0);
...
mylistofnodes.add(mytreenode); // &amp;lt;--- here&lt;/PRE&gt;
 &lt;P&gt;Could be an issue happening elsewhere in my code, but I believe I have isolated it here. I'll investigate, but do you have any ideas on what could be causing this? There error I'm getting is just a generic exception in &lt;EM&gt;processeventinlist&lt;/EM&gt;.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 13 Feb 2023 16:08:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/bind-nodelistarray-from-within-sdt-class/m-p/13546530#M52135</guid>
      <dc:creator>thomas_smithWKC4J</dc:creator>
      <dc:date>2023-02-13T16:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Bind NodeListArray from within SDT class</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/bind-nodelistarray-from-within-sdt-class/m-p/13546531#M52136</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Nevermind, I figured it out. I was creating an instance of my SDT, then adding to its NodeListArray, then adding to the tree. 
 &lt;P&gt;I fixed it by creating the instance, &lt;EM&gt;immediately &lt;/EM&gt;adding it to the tree, and &lt;EM&gt;then&lt;/EM&gt; manipulating the NodeListArray.&lt;/P&gt;
 &lt;P&gt;Thanks again for your help. &lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 13 Feb 2023 19:11:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/bind-nodelistarray-from-within-sdt-class/m-p/13546531#M52136</guid>
      <dc:creator>thomas_smithWKC4J</dc:creator>
      <dc:date>2023-02-13T19:11:44Z</dc:date>
    </item>
  </channel>
</rss>

