<?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: How to add new element to array? in Bifrost Forum</title>
    <link>https://forums.autodesk.com/t5/bifrost-forum/how-to-add-new-element-to-array/m-p/10241282#M3780</link>
    <description>&lt;P&gt;Ports states has to be the same data type. In this case you want to append the computed value on an empty array on which you append a value at each iterations.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="build_array_inside_loop1.jpg" style="width: 662px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/907047i22863105AD86773E/image-size/large?v=v2&amp;amp;px=999" role="button" title="build_array_inside_loop1.jpg" alt="build_array_inside_loop1.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="build_array_inside_loop2.jpg" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/907048i7595384044E9D7D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="build_array_inside_loop2.jpg" alt="build_array_inside_loop2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Apr 2021 15:03:03 GMT</pubDate>
    <dc:creator>mjcg91</dc:creator>
    <dc:date>2021-04-15T15:03:03Z</dc:date>
    <item>
      <title>How to add new element to array?</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/how-to-add-new-element-to-array/m-p/10241044#M3779</link>
      <description>&lt;P&gt;Suppose I want to divide a value equally, and then add these values together and store them in an array. For example, 90 is divided into 3 equal parts, and the cumulative result is [30, 60, 90]. I can do this in Python:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;v = 90 # value
max = 3 # max_iterations
i = 1 # current_index
step = i/max
degrees = [] # output array
while i &amp;lt;= max:
    degree = step*v*i
    degrees.append(degree)
    i += 1
print(degrees)
# Result: [30.0, 60.0, 90.0] #&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;But how to do this in bifrost?&lt;/P&gt;&lt;P&gt;My graph is not working...&lt;/P&gt;&lt;P&gt;outside:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maya_wpxUhW0Rrm.jpg" style="width: 773px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/906998i6865478D45023D7D/image-size/large?v=v2&amp;amp;px=999" role="button" title="maya_wpxUhW0Rrm.jpg" alt="maya_wpxUhW0Rrm.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;inside&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maya_k3eGd6owBq.jpg" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/906999iA3844D1B8C0D92C8/image-size/large?v=v2&amp;amp;px=999" role="button" title="maya_k3eGd6owBq.jpg" alt="maya_k3eGd6owBq.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I got warning:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;"output", Warnings: - array Warning: while compiling top level compound "bifrostGraphShape1", around the port 'bifrostGraphShape1::iterate.array': no promotion exists from a value of type 'array&amp;lt;float&amp;gt;' to a value of type 'float'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;why?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 13:58:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/how-to-add-new-element-to-array/m-p/10241044#M3779</guid>
      <dc:creator>g2m.agent</dc:creator>
      <dc:date>2021-04-15T13:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new element to array?</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/how-to-add-new-element-to-array/m-p/10241282#M3780</link>
      <description>&lt;P&gt;Ports states has to be the same data type. In this case you want to append the computed value on an empty array on which you append a value at each iterations.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="build_array_inside_loop1.jpg" style="width: 662px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/907047i22863105AD86773E/image-size/large?v=v2&amp;amp;px=999" role="button" title="build_array_inside_loop1.jpg" alt="build_array_inside_loop1.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="build_array_inside_loop2.jpg" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/907048i7595384044E9D7D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="build_array_inside_loop2.jpg" alt="build_array_inside_loop2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 15:03:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/how-to-add-new-element-to-array/m-p/10241282#M3780</guid>
      <dc:creator>mjcg91</dc:creator>
      <dc:date>2021-04-15T15:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new element to array?</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/how-to-add-new-element-to-array/m-p/10241912#M3781</link>
      <description>It works. But I don't understand how this iteration works. why doesn't "build_array" become a 2d array? this "visualization" is more confusing than the code.</description>
      <pubDate>Thu, 15 Apr 2021 17:48:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/how-to-add-new-element-to-array/m-p/10241912#M3781</guid>
      <dc:creator>g2m.agent</dc:creator>
      <dc:date>2021-04-15T17:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new element to array?</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/how-to-add-new-element-to-array/m-p/10241981#M3782</link>
      <description>&lt;P&gt;build_array works like append in Python. Is will either create an array from a single value or append values to an existing array.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 18:21:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/how-to-add-new-element-to-array/m-p/10241981#M3782</guid>
      <dc:creator>mjcg91</dc:creator>
      <dc:date>2021-04-15T18:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new element to array?</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/how-to-add-new-element-to-array/m-p/10241996#M3783</link>
      <description>&lt;P&gt;Btw if all you want to do is like the function above, you might as well do it in a for-each loop and directly plug the value to the output. It's gonna be much faster. If your array's construction is not based on a conditions, or if you don't have to access the active array data during the loop, there is no reason tobuse iterate or do-while loops.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 18:27:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/how-to-add-new-element-to-array/m-p/10241996#M3783</guid>
      <dc:creator>mjcg91</dc:creator>
      <dc:date>2021-04-15T18:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new element to array?</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/how-to-add-new-element-to-array/m-p/10243027#M3784</link>
      <description>&lt;P&gt;the for-each loop gives me 2d array:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maya_UYVxDd8Ol1.jpg" style="width: 656px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/907415i7C6EC4BE555BD797/image-size/large?v=v2&amp;amp;px=999" role="button" title="maya_UYVxDd8Ol1.jpg" alt="maya_UYVxDd8Ol1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;inside:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maya_BVLlSKGjko.jpg" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/907416iA27964E25DA9BB62/image-size/large?v=v2&amp;amp;px=999" role="button" title="maya_BVLlSKGjko.jpg" alt="maya_BVLlSKGjko.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 04:50:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/how-to-add-new-element-to-array/m-p/10243027#M3784</guid>
      <dc:creator>g2m.agent</dc:creator>
      <dc:date>2021-04-16T04:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new element to array?</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/how-to-add-new-element-to-array/m-p/10243077#M3785</link>
      <description>&lt;P&gt;you don't need a build array node inside for each, nor have to init an empty array. Just plug the single values to the output. Also pay attention to port icons.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 05:43:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/how-to-add-new-element-to-array/m-p/10243077#M3785</guid>
      <dc:creator>mjcg91</dc:creator>
      <dc:date>2021-04-16T05:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to add new element to array?</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/how-to-add-new-element-to-array/m-p/10243164#M3786</link>
      <description>&lt;P&gt;thank you! that helps a lot.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 06:35:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/how-to-add-new-element-to-array/m-p/10243164#M3786</guid>
      <dc:creator>g2m.agent</dc:creator>
      <dc:date>2021-04-16T06:35:04Z</dc:date>
    </item>
  </channel>
</rss>

