<?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: how to make a wide path to be showed using Network node OnDraw Trigger? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-make-a-wide-path-to-be-showed-using-network-node-ondraw/m-p/13552970#M57167</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Some trig will be involved for this and the commands you will need are drawtomodelscale() and either drawrect, drawrectangle or drawquad(). (fglRotate() might also help)&lt;/P&gt;&lt;P&gt;You'll also want the other node coordinates relative to the current node for a given port :&lt;/P&gt;&lt;PRE&gt;Vec3 otherloc = current.outObjects[port].location.project(&lt;SPAN style="color: rgb(65, 65, 65); font-family: sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;current.outObjects[port]&lt;/SPAN&gt;.up,current);&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="color: rgb(65, 65, 65); font-family: sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;and then the angle from one node to another will be &lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;Math.degrees(Math.atan2(otherloc.y,otherloc.x))&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If you were using an up to date version the vector logic is much simpler:&lt;/P&gt;&lt;PRE&gt;double pathwidth=2;
drawtomodelscale(current);
for (int n=current.outObjects.length;n&amp;gt;0;n--) {
Vec3 otherloc = current.outObjects&lt;N&gt;.location.project(current.outObjects&lt;N&gt;.up,current);
Vec2 other2=Vec2(otherloc.x,otherloc.y);
Vec2 unit=other2/other2.magnitude*pathwidth/2;
Vec2 leftoff=unit.rotate(90);
Vec2 p1=leftoff;
Vec2 p2=-leftoff;
Vec2 p3=p2+other2;
Vec2 p4=p3+leftoff*2;
drawquad(view,p1.x,p1.y,0,p2.x,p2.y,0,p3.x,p3.y,0,p4.x,p4.y,0,0,1,0);
}&lt;/N&gt;&lt;/N&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 17 Mar 2022 23:52:22 GMT</pubDate>
    <dc:creator>jason_lightfoot_adsk</dc:creator>
    <dc:date>2022-03-17T23:52:22Z</dc:date>
    <item>
      <title>how to make a wide path to be showed using Network node OnDraw Trigger?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-make-a-wide-path-to-be-showed-using-network-node-ondraw/m-p/13552967#M57164</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 19.2.4 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Mar 2022 14:28:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-make-a-wide-path-to-be-showed-using-network-node-ondraw/m-p/13552967#M57164</guid>
      <dc:creator>raviraj_v</dc:creator>
      <dc:date>2022-03-17T14:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a wide path to be showed using Network node OnDraw Trigger?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-make-a-wide-path-to-be-showed-using-network-node-ondraw/m-p/13552968#M57165</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/36311/ravirajv.html" nodeid="36311"&gt;@Raviraj V&lt;/A&gt;, you want to visualize a street?&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Mar 2022 14:53:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-make-a-wide-path-to-be-showed-using-network-node-ondraw/m-p/13552968#M57165</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2022-03-17T14:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a wide path to be showed using Network node OnDraw Trigger?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-make-a-wide-path-to-be-showed-using-network-node-ondraw/m-p/13552969#M57166</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Create a wide using OnDraw in network nodes &lt;span class="lia-inline-image-display-wrapper" image-alt="wide-path.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1509445i95138BFF432184DC/image-size/large?v=v2&amp;amp;px=999" role="button" title="wide-path.png" alt="wide-path.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Mar 2022 15:02:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-make-a-wide-path-to-be-showed-using-network-node-ondraw/m-p/13552969#M57166</guid>
      <dc:creator>raviraj_v</dc:creator>
      <dc:date>2022-03-17T15:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a wide path to be showed using Network node OnDraw Trigger?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-make-a-wide-path-to-be-showed-using-network-node-ondraw/m-p/13552970#M57167</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Some trig will be involved for this and the commands you will need are drawtomodelscale() and either drawrect, drawrectangle or drawquad(). (fglRotate() might also help)&lt;/P&gt;&lt;P&gt;You'll also want the other node coordinates relative to the current node for a given port :&lt;/P&gt;&lt;PRE&gt;Vec3 otherloc = current.outObjects[port].location.project(&lt;SPAN style="color: rgb(65, 65, 65); font-family: sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;current.outObjects[port]&lt;/SPAN&gt;.up,current);&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="color: rgb(65, 65, 65); font-family: sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;and then the angle from one node to another will be &lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;Math.degrees(Math.atan2(otherloc.y,otherloc.x))&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If you were using an up to date version the vector logic is much simpler:&lt;/P&gt;&lt;PRE&gt;double pathwidth=2;
drawtomodelscale(current);
for (int n=current.outObjects.length;n&amp;gt;0;n--) {
Vec3 otherloc = current.outObjects&lt;N&gt;.location.project(current.outObjects&lt;N&gt;.up,current);
Vec2 other2=Vec2(otherloc.x,otherloc.y);
Vec2 unit=other2/other2.magnitude*pathwidth/2;
Vec2 leftoff=unit.rotate(90);
Vec2 p1=leftoff;
Vec2 p2=-leftoff;
Vec2 p3=p2+other2;
Vec2 p4=p3+leftoff*2;
drawquad(view,p1.x,p1.y,0,p2.x,p2.y,0,p3.x,p3.y,0,p4.x,p4.y,0,0,1,0);
}&lt;/N&gt;&lt;/N&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Mar 2022 23:52:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-make-a-wide-path-to-be-showed-using-network-node-ondraw/m-p/13552970#M57167</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2022-03-17T23:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a wide path to be showed using Network node OnDraw Trigger?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-make-a-wide-path-to-be-showed-using-network-node-ondraw/m-p/13552971#M57168</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/36311/ravirajv.html" nodeid="36311"&gt;@Raviraj V&lt;/A&gt;, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.&lt;/P&gt;&lt;P&gt;If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 Mar 2022 15:57:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-make-a-wide-path-to-be-showed-using-network-node-ondraw/m-p/13552971#M57168</guid>
      <dc:creator>ryan_c10</dc:creator>
      <dc:date>2022-03-23T15:57:23Z</dc:date>
    </item>
  </channel>
</rss>

