<?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 Get path reference in Conditional Rule in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/get-path-reference-in-conditional-rule/m-p/13573482#M73224</link>
    <description>&lt;P&gt;&lt;I&gt;[ FlexSim 23.1.3 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hi all,&lt;/P&gt;
 &lt;P&gt;I am trying to set a conditional rule for a straight path. I need to get the path reference in the code, so I can access a label I assigned to the path and then check if this label matches with a label on the AGV. Can someone help me out on how to do this, please?&lt;BR /&gt;Thanks&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Fri, 25 Aug 2023 10:40:40 GMT</pubDate>
    <dc:creator>jacopo_r</dc:creator>
    <dc:date>2023-08-25T10:40:40Z</dc:date>
    <item>
      <title>Get path reference in Conditional Rule</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/get-path-reference-in-conditional-rule/m-p/13573482#M73224</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 23.1.3 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hi all,&lt;/P&gt;
 &lt;P&gt;I am trying to set a conditional rule for a straight path. I need to get the path reference in the code, so I can access a label I assigned to the path and then check if this label matches with a label on the AGV. Can someone help me out on how to do this, please?&lt;BR /&gt;Thanks&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Aug 2023 10:40:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/get-path-reference-in-conditional-rule/m-p/13573482#M73224</guid>
      <dc:creator>jacopo_r</dc:creator>
      <dc:date>2023-08-25T10:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Get path reference in Conditional Rule</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/get-path-reference-in-conditional-rule/m-p/13573483#M73225</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Just like AStar barrier rules the Conditional Rules are not object based so you can't get a reference to a path to find its attributes afaik.   You can try to use the route cost which is a path based - but there you have no agv reference.&lt;/P&gt;&lt;P&gt;Alternatively look at the AGV Customization Delegate which may provide the required hooks for you to achieve your goal.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Aug 2023 10:55:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/get-path-reference-in-conditional-rule/m-p/13573483#M73225</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-08-25T10:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Get path reference in Conditional Rule</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/get-path-reference-in-conditional-rule/m-p/13573484#M73226</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Thank you for the answer
&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Aug 2023 10:57:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/get-path-reference-in-conditional-rule/m-p/13573484#M73226</guid>
      <dc:creator>jacopo_r</dc:creator>
      <dc:date>2023-08-25T10:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Get path reference in Conditional Rule</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/get-path-reference-in-conditional-rule/m-p/13573485#M73227</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;You could also define a rule for each possible label value and then use code to switch which rule applies to the path depending on the path label.&lt;/P&gt;&lt;PRE&gt;Object path = Model.find("AGVNetwork/Path1");
treenode condition = getvarnode(path, "condition");
treenode pathConditions = Model.find("AGVNetwork&amp;gt;variables/pathConditions");
condition.value = pathConditions.subnodes[path.Type];&lt;/PRE&gt;&lt;P&gt;Or, as Jason mentioned, use the &lt;EM&gt;getPathTravelWeight&lt;/EM&gt; hook of the customization delegate.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Aug 2023 11:07:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/get-path-reference-in-conditional-rule/m-p/13573485#M73227</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2023-08-25T11:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Get path reference in Conditional Rule</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/get-path-reference-in-conditional-rule/m-p/13573486#M73228</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Thanks for the additional solution &lt;A rel="user" href="https://answers.flexsim.com/users/19365/felixmh.html" nodeid="19365"&gt;@Felix Möhlmann&lt;/A&gt; &lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;I am not sure I understood it correctly, specifically where to place the suggested code. &lt;BR /&gt;To make it clearer, here's what I need to do.&lt;BR /&gt;&lt;BR /&gt;I am simulating a container terminal and there are different storage sections. I want my trucks (AGVs) to drive on a storage connected path (see picture) only if they have to load or unload a container to or from that section, otherwise I would like them to use the lower path. My idea is to set a label on the path related to the storage with the reference of the storage section, while on the AGV I set a label with the reference of the section it has to drive to. Therefore if the label does not match, then an AGV should not be able to drive another path that is connected to another section.&lt;/P&gt;
 &lt;P&gt;Any suggestion for implementing this? thanks&lt;span class="lia-inline-image-display-wrapper" image-alt="1692963144647.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1519194i7551C9424323F3C3/image-size/large?v=v2&amp;amp;px=999" role="button" title="1692963144647.png" alt="1692963144647.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Aug 2023 11:32:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/get-path-reference-in-conditional-rule/m-p/13573486#M73228</guid>
      <dc:creator>jacopo_r</dc:creator>
      <dc:date>2023-08-25T11:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Get path reference in Conditional Rule</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/get-path-reference-in-conditional-rule/m-p/13573487#M73229</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;My idea mostly aimed at providing a way to change the rule a path is using on the fly. I don't think this would be necessary here.&lt;P&gt;Just create a rule for each such path, storing the required TE label value to travel on the path as a label on the respective storage object. After you know where the TE is going, change its label to the value stored on the storage object.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Aug 2023 12:18:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/get-path-reference-in-conditional-rule/m-p/13573487#M73229</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2023-08-25T12:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get path reference in Conditional Rule</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/get-path-reference-in-conditional-rule/m-p/13573488#M73230</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Your idea helped. Thanks
&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Aug 2023 13:34:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/get-path-reference-in-conditional-rule/m-p/13573488#M73230</guid>
      <dc:creator>jacopo_r</dc:creator>
      <dc:date>2023-08-25T13:34:24Z</dc:date>
    </item>
  </channel>
</rss>

