<?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: Connecting GIS Points from Global Table in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/connecting-gis-points-from-global-table/m-p/13578563#M77205</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;I don't know how you got to using &lt;EM&gt;connections[], &lt;/EM&gt;but it is just a shortcut to access the node where the port connections of an object are stored in its attribute tree. So using this here will naturally not do anything/produce errors.&lt;/P&gt;&lt;P&gt;Your logic makes sense if you add the created points to an array and use those entries in &lt;EM&gt;contextdragconnection().&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;Table points = Table("Locations");&lt;BR /&gt;&lt;STRONG&gt;Array GISPoints = [];&lt;/STRONG&gt;
Model.find("GISNavigator").subnodes.clear();
for (int i = 1; i &amp;lt;= points.numRows; i++) {
&amp;nbsp; &amp;nbsp; string id = points &lt;I&gt;[1];
&amp;nbsp; &amp;nbsp; double lat = points&lt;I&gt;[2];
&amp;nbsp; &amp;nbsp; double long = points&lt;I&gt;[3];
&amp;nbsp; &amp;nbsp; Object point = Object.create("GIS::Point");
&amp;nbsp; &amp;nbsp; point.setProperty("Latitude", lat);
&amp;nbsp; &amp;nbsp; point.setProperty("Longitude", long);
&amp;nbsp; &amp;nbsp; setname(point, id);
&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;&amp;nbsp;GISPoints.push(point);&lt;/STRONG&gt;
}

Table routes = Table ("Connections");
for (int i = 1; i &amp;lt;= routes.numRows; i++ ) {
&amp;nbsp; &amp;nbsp; for (int j = i+1; j &amp;lt;= routes.numCols; j++ ) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if &amp;nbsp; &amp;nbsp;(routes&lt;I&gt;&lt;J&gt; == 1 ) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; contextdragconnection (&lt;STRONG&gt;GISPoints&lt;I&gt;, GISPoints&lt;J&gt;&lt;/J&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;I&gt;, "A");
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; }
}&lt;/I&gt;&lt;/J&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;P&gt;Furthermore, I would suggest to format your table differently, otherwise you will have to take into account an offset in the index between the locations and connections table.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="capture1.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1516677i708C590861D21B1B/image-size/large?v=v2&amp;amp;px=999" role="button" title="capture1.png" alt="capture1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Additionally your code currently only looks at the upper right half of the table (which makes sense if the table were symmetric).&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 17 Apr 2023 12:20:54 GMT</pubDate>
    <dc:creator>moehlmann_fe</dc:creator>
    <dc:date>2023-04-17T12:20:54Z</dc:date>
    <item>
      <title>Connecting GIS Points from Global Table</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/connecting-gis-points-from-global-table/m-p/13578562#M77204</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 23.1.1 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/67211-network-test.fsm" target="_blank"&gt;Network_Test.fsm&lt;/A&gt;Hello,&lt;/P&gt;
 &lt;P&gt;I created points on GIS Module by Script as follows;&lt;/P&gt;
 &lt;PRE&gt;&lt;STRONG&gt;Table&lt;/STRONG&gt; points = &lt;STRONG&gt;Table&lt;/STRONG&gt;("Locations");
&lt;STRONG&gt;Model&lt;/STRONG&gt;.find("GISNavigator").subnodes.clear();
&lt;STRONG&gt;for&lt;/STRONG&gt; (&lt;STRONG&gt;int&lt;/STRONG&gt; i = 1; i &amp;lt;= points.numRows; i++) {
&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;string&lt;/STRONG&gt; id = points &lt;I&gt;[1];
&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;double&lt;/STRONG&gt; lat = points&lt;I&gt;[2];
&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;double&lt;/STRONG&gt; long = points&lt;I&gt;[3];
&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;Object&lt;/STRONG&gt; point = &lt;STRONG&gt;Object&lt;/STRONG&gt;.create("GIS::Point");
&amp;nbsp; &amp;nbsp;&amp;nbsp;point.setProperty("Latitude",&amp;nbsp;lat);
&amp;nbsp; &amp;nbsp;&amp;nbsp;point.setProperty("Longitude",&amp;nbsp;long);
&amp;nbsp; &amp;nbsp;&amp;nbsp;setname(point,&amp;nbsp;id);
}&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;I want to connect points according to the "Connections" global table according to cells that contains value "1"&lt;/P&gt;
 &lt;PRE&gt;&lt;STRONG&gt;for&lt;/STRONG&gt; (&lt;STRONG&gt;int&lt;/STRONG&gt; i = 1; i &amp;lt;= routes.numRows; i++ ) {
&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;for&lt;/STRONG&gt; (&lt;STRONG&gt;int&lt;/STRONG&gt; j = i+1; j &amp;lt;= routes.numCols; j++ ) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;if&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; (routes&lt;I&gt;&lt;J&gt; == 1 ) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;contextdragconnection&amp;nbsp;(&amp;nbsp;connections&lt;I&gt;,&amp;nbsp;connections&lt;J&gt;,&amp;nbsp;"A");
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; }
}&lt;/J&gt;&lt;/I&gt;&lt;/J&gt;&lt;/I&gt;&lt;/PRE&gt;
 &lt;P&gt;I tried to connect with contextdragconnection command but failed. How should I update my script?&lt;/P&gt;
 &lt;P&gt;Thank you,&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 17 Apr 2023 11:30:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/connecting-gis-points-from-global-table/m-p/13578562#M77204</guid>
      <dc:creator>kadircan_t</dc:creator>
      <dc:date>2023-04-17T11:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting GIS Points from Global Table</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/connecting-gis-points-from-global-table/m-p/13578563#M77205</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;I don't know how you got to using &lt;EM&gt;connections[], &lt;/EM&gt;but it is just a shortcut to access the node where the port connections of an object are stored in its attribute tree. So using this here will naturally not do anything/produce errors.&lt;/P&gt;&lt;P&gt;Your logic makes sense if you add the created points to an array and use those entries in &lt;EM&gt;contextdragconnection().&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;Table points = Table("Locations");&lt;BR /&gt;&lt;STRONG&gt;Array GISPoints = [];&lt;/STRONG&gt;
Model.find("GISNavigator").subnodes.clear();
for (int i = 1; i &amp;lt;= points.numRows; i++) {
&amp;nbsp; &amp;nbsp; string id = points &lt;I&gt;[1];
&amp;nbsp; &amp;nbsp; double lat = points&lt;I&gt;[2];
&amp;nbsp; &amp;nbsp; double long = points&lt;I&gt;[3];
&amp;nbsp; &amp;nbsp; Object point = Object.create("GIS::Point");
&amp;nbsp; &amp;nbsp; point.setProperty("Latitude", lat);
&amp;nbsp; &amp;nbsp; point.setProperty("Longitude", long);
&amp;nbsp; &amp;nbsp; setname(point, id);
&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;&amp;nbsp;GISPoints.push(point);&lt;/STRONG&gt;
}

Table routes = Table ("Connections");
for (int i = 1; i &amp;lt;= routes.numRows; i++ ) {
&amp;nbsp; &amp;nbsp; for (int j = i+1; j &amp;lt;= routes.numCols; j++ ) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if &amp;nbsp; &amp;nbsp;(routes&lt;I&gt;&lt;J&gt; == 1 ) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; contextdragconnection (&lt;STRONG&gt;GISPoints&lt;I&gt;, GISPoints&lt;J&gt;&lt;/J&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;I&gt;, "A");
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; }
}&lt;/I&gt;&lt;/J&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;P&gt;Furthermore, I would suggest to format your table differently, otherwise you will have to take into account an offset in the index between the locations and connections table.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="capture1.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1516677i708C590861D21B1B/image-size/large?v=v2&amp;amp;px=999" role="button" title="capture1.png" alt="capture1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Additionally your code currently only looks at the upper right half of the table (which makes sense if the table were symmetric).&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 17 Apr 2023 12:20:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/connecting-gis-points-from-global-table/m-p/13578563#M77205</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2023-04-17T12:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Connecting GIS Points from Global Table</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/connecting-gis-points-from-global-table/m-p/13578564#M77206</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Thank you &lt;A rel="user" href="https://answers.flexsim.com/users/19365/felixmh.html" nodeid="19365"&gt;@Felix Möhlmann&lt;/A&gt; , This is what I am looking for.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 17 Apr 2023 13:16:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/connecting-gis-points-from-global-table/m-p/13578564#M77206</guid>
      <dc:creator>kadircan_t</dc:creator>
      <dc:date>2023-04-17T13:16:24Z</dc:date>
    </item>
  </channel>
</rss>

