<?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: Create Beams using the API in Moldflow Insight Forum</title>
    <link>https://forums.autodesk.com/t5/moldflow-insight-forum/create-beams-using-the-api/m-p/10032125#M2388</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1163266"&gt;@M.Brassel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for giving me a new approach to solve this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will test it and come back to you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jan 2021 14:25:18 GMT</pubDate>
    <dc:creator>_JoThu_</dc:creator>
    <dc:date>2021-01-26T14:25:18Z</dc:date>
    <item>
      <title>Create Beams using the API</title>
      <link>https://forums.autodesk.com/t5/moldflow-insight-forum/create-beams-using-the-api/m-p/9948971#M2386</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to use the API to create some beam elements and to assign all elements that have been created to a certain layer. But besides of creating beams, the feature also creates curves and nodes, which I cannot access.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below you can find simplified code to get a better understanding:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;'Create layer
Set TestLayer = Synergy.LayerManager.CreateLayerByName ("Test Layer")

'Prepare beam creation
Set Vector = Synergy.CreateVector()
Vector.SetXYZ 0, 0, 0
Set Vector_1 = Synergy.CreateVector()
Vector_1.SetXYZ 0, 0, 150
Set MeshEditor = Synergy.MeshEditor()
Set Prop = MeshEditor.FindProperty(40420, 1)

'Create beams -&amp;gt; Output: EntList with created beam elements
Set EntList_Beams = MeshEditor.CreateBeamsByPoints(Vector, Vector_1, 10, Prop)

'Assign beam elements to layer
Synergy.LayerManager.AssignToLayer EntList_Beams, TestLayer&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, everything works fine.&lt;/P&gt;&lt;P&gt;As the code shows, the return of CreateBeamsByPoints is a EntList with created beam elements, which makes it very easy to assign them to a layer. Unfortunately the curves and nodes which are created during this process as well, are not part of this EntList.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have an idea how to get a EntList with these curves and nodes?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your support and&lt;/P&gt;&lt;P&gt;best regardes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jochen&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 13:53:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/moldflow-insight-forum/create-beams-using-the-api/m-p/9948971#M2386</guid>
      <dc:creator>_JoThu_</dc:creator>
      <dc:date>2020-12-18T13:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create Beams using the API</title>
      <link>https://forums.autodesk.com/t5/moldflow-insight-forum/create-beams-using-the-api/m-p/9984002#M2387</link>
      <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4392107"&gt;@_JoThu_&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;I think you could create a layer and make it active. So the new end nodes should be created in the active layer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a workflow that might help:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Also you could examine your highest node ID or curve ID.&lt;/LI&gt;&lt;LI&gt;So you know the IDs of all your newly created nodes, depending on the number of elements you created. The number of curves depends on how often you repeat your step of creating beams.&lt;/LI&gt;&lt;LI&gt;Then you could create an entity list containing these node IDs or curve IDs. Here are some examples:&lt;UL&gt;&lt;LI&gt;&lt;DIV class="contents"&gt;&lt;DIV class="memitem"&gt;&lt;DIV class="memdoc"&gt;&lt;DIV class="fragment"&gt;&lt;PRE&gt;EntList.SelectFromString &lt;SPAN class="stringliteral"&gt;"N18 N23"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV class="contents"&gt;&lt;DIV class="memitem"&gt;&lt;DIV class="memdoc"&gt;&lt;DIV class="fragment"&gt;&lt;PRE&gt;Set Predicate1 = &lt;A title="This class is used to create Predicate objects." href="https://forums.autodesk.com/classPredicateManager.html" target="_blank" rel="noopener"&gt;PredicateManager&lt;/A&gt;.CreateLabelPredicate(&lt;SPAN class="stringliteral"&gt;"N23:N100"&lt;/SPAN&gt;)
EntList.SelectFromPredicate Predicate1 &lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Then you could assign these nodes or curves to a specific layer as you did with the beams before.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I wish you fun and success with your programming task.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 09:00:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/moldflow-insight-forum/create-beams-using-the-api/m-p/9984002#M2387</guid>
      <dc:creator>M.Brassel</dc:creator>
      <dc:date>2021-01-07T09:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create Beams using the API</title>
      <link>https://forums.autodesk.com/t5/moldflow-insight-forum/create-beams-using-the-api/m-p/10032125#M2388</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1163266"&gt;@M.Brassel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for giving me a new approach to solve this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will test it and come back to you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 14:25:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/moldflow-insight-forum/create-beams-using-the-api/m-p/10032125#M2388</guid>
      <dc:creator>_JoThu_</dc:creator>
      <dc:date>2021-01-26T14:25:18Z</dc:date>
    </item>
  </channel>
</rss>

