<?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 Robot API in Grasshopper in Robot Structural Analysis Forum</title>
    <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/robot-api-in-grasshopper/m-p/9634305#M18707</link>
    <description>&lt;P&gt;I am developing a plugin in C# to interface with Robot through Grasshopper. Given that we need to write one class per component, I am forced to instantiate the Robot application object in each component's constructor separately as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="hljs-keyword"&gt;namespace&lt;/SPAN&gt; &lt;SPAN class="hljs-title"&gt;HelloGrasshopper&lt;/SPAN&gt;
{
  &lt;SPAN class="hljs-keyword"&gt;public&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;class&lt;/SPAN&gt; &lt;SPAN class="hljs-title"&gt;MyFirstComponent&lt;/SPAN&gt; : &lt;SPAN class="hljs-title"&gt;GH_Component&lt;/SPAN&gt;
  {&lt;BR /&gt;    private IRobotApplication robotApp;&lt;BR /&gt;
    &lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;public&lt;/SPAN&gt; &lt;SPAN class="hljs-title"&gt;MyFirstComponent&lt;/SPAN&gt;() : &lt;SPAN class="hljs-title"&gt;base&lt;/SPAN&gt;(&lt;SPAN class="hljs-params"&gt;&lt;SPAN class="hljs-string"&gt;"MyFirst"&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"MFC"&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"My first component"&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"Extra"&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"Simple"&lt;/SPAN&gt;&lt;/SPAN&gt;)
    &lt;/SPAN&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;     robotApp&amp;nbsp; = new IRobotApplication();
    }&lt;BR /&gt;...&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to reuse the same app object rather than instantiating it in each component separately? Grasshopper only allows components to interact through in/out links.&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;</description>
    <pubDate>Tue, 14 Jul 2020 11:38:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-07-14T11:38:28Z</dc:date>
    <item>
      <title>Robot API in Grasshopper</title>
      <link>https://forums.autodesk.com/t5/robot-structural-analysis-forum/robot-api-in-grasshopper/m-p/9634305#M18707</link>
      <description>&lt;P&gt;I am developing a plugin in C# to interface with Robot through Grasshopper. Given that we need to write one class per component, I am forced to instantiate the Robot application object in each component's constructor separately as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="hljs-keyword"&gt;namespace&lt;/SPAN&gt; &lt;SPAN class="hljs-title"&gt;HelloGrasshopper&lt;/SPAN&gt;
{
  &lt;SPAN class="hljs-keyword"&gt;public&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;class&lt;/SPAN&gt; &lt;SPAN class="hljs-title"&gt;MyFirstComponent&lt;/SPAN&gt; : &lt;SPAN class="hljs-title"&gt;GH_Component&lt;/SPAN&gt;
  {&lt;BR /&gt;    private IRobotApplication robotApp;&lt;BR /&gt;
    &lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;public&lt;/SPAN&gt; &lt;SPAN class="hljs-title"&gt;MyFirstComponent&lt;/SPAN&gt;() : &lt;SPAN class="hljs-title"&gt;base&lt;/SPAN&gt;(&lt;SPAN class="hljs-params"&gt;&lt;SPAN class="hljs-string"&gt;"MyFirst"&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"MFC"&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"My first component"&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"Extra"&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"Simple"&lt;/SPAN&gt;&lt;/SPAN&gt;)
    &lt;/SPAN&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;     robotApp&amp;nbsp; = new IRobotApplication();
    }&lt;BR /&gt;...&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to reuse the same app object rather than instantiating it in each component separately? Grasshopper only allows components to interact through in/out links.&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;</description>
      <pubDate>Tue, 14 Jul 2020 11:38:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/robot-structural-analysis-forum/robot-api-in-grasshopper/m-p/9634305#M18707</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-14T11:38:28Z</dc:date>
    </item>
  </channel>
</rss>

