<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>point grid by function - correctly labeled</title><link>https://communities.bentley.com/products/products_generativecomponents/f/generativecomponents---forum/159100/point-grid-by-function---correctly-labeled</link><description>Hi there, 
 I couldn&amp;#39;t find any help on this topic - so two questions. 
 
 Is there any manual dealing with gc scripting - especially dealing with functions (for Connect Edition Version of GC)? 
 I&amp;#39;m fiddling around with a point grid function which gives</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: point grid by function - correctly labeled</title><link>https://communities.bentley.com/thread/477793?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2018 21:41:24 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:1d8f08ac-01cb-4cb2-a223-df449b3b4c3d</guid><dc:creator>Mueller</dc:creator><description>&lt;p&gt;Good news: the July SIG &amp;quot;Zero to Simple Scripting&amp;quot; has now been posted to the GC SIG learning path (&lt;a href="https://learn.bentley.com/app/Public/ViewLearningPathDetails?lpId=111738"&gt;https://learn.bentley.com/app/Public/ViewLearningPathDetails?lpId=111738&lt;/a&gt;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: point grid by function - correctly labeled</title><link>https://communities.bentley.com/thread/476434?ContentTypeID=1</link><pubDate>Tue, 14 Aug 2018 18:36:06 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:83ccc404-5764-4865-b79f-a608ad94f6fc</guid><dc:creator>Mueller</dc:creator><description>&lt;p&gt;Hi Ingo,&lt;/p&gt;
&lt;p&gt;There is information about scripting in the GenerativeComponents Help which is accessible in CONNECT Edition under the AECOsim Building Designer &amp;quot;Computational Design&amp;quot; workflow&amp;#39;s Help ribbon tab&amp;#39;s Content icon. It&amp;#39;s in the section GCScript Programming.&lt;/p&gt;
&lt;p&gt;The SIG workshops November 2017 &amp;quot;Simple Scripting&amp;quot; and July 2018 &amp;quot;Zero to Simple Scripting&amp;quot; also deal with scripting. Latter SIG workshop recording still needs to be posted to the GC SIG learning path (&lt;a href="https://learn.bentley.com/app/Public/ViewLearningPathDetails?lpId=111738"&gt;https://learn.bentley.com/app/Public/ViewLearningPathDetails?lpId=111738&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;In your Point.ByFunction, points will need to be generated in a two-level hierarchy for indexing as two-dimensional array. In the outer loop, add &amp;quot;Point pntlist = new Point(this);&amp;quot; in the inner loop, change how you create the Point pts1, so that pts1 are grand-children of pts1.&amp;nbsp;If this is confusing, then it&amp;#39;s because your variable name in the function is the same as the Point node&amp;#39;s top level name. The line in the inner loop becomes &amp;quot;Point pts1 = new Point(pntlist);&amp;quot; I suggest renaming that latter variable to e.g. &amp;quot;pnt&amp;quot;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;transaction 3 modelChange &amp;#39;Add pts1&amp;#39;
{
    node User.Objects.pts1 Bentley.GC.NodeTypes.Point
    {
        Technique                 = &amp;#39;ByFunction&amp;#39;;
        Function                  = function (CoordinateSystem cs01)
                                    {          
                                     
                                      for (int i = 0; i &amp;lt; NrGrid.Value; ++i)
                                        {
                                            Point pntlist = new Point(this);
                                            
                                            for (int j = 0; j &amp;lt; NrGrid.Value; ++j)
                                            {
                                                    
                                                Point pnt = new Point(pntlist) ;
                                                pnt.ByCartesianCoordinates(cs1,i,j,0);
                                            }
                                        }   
                                        
                                    };
        cs01                      = cs1;
    }
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The point lists &amp;quot;pntlist&amp;quot; generated in each iteration of the outer loop are children of the top level Point node &amp;quot;pts1&amp;quot;. The points &amp;quot;pnt&amp;quot; generated in the inner loop are generated as children to each &amp;quot;pntlist&amp;quot;, and, therefore, as grand-children to &amp;quot;pts1&amp;quot;. This generates a two-dimensional array of points. pts1[i][j] then indexes the j&amp;#39;s grand-child point in the i&amp;#39;s child point list of pts1.&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Volker&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>