<?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 do I make a AGV level battery display? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-make-a-agv-level-battery-display/m-p/13576005#M75182</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Here's some battery level indicator draw code for the agv object (for those finding this post from the title but wanting a graphical representation):&lt;/P&gt;&lt;PRE&gt;// If this function returns a true, the default draw code of the object will not be executed.
drawtomodelscale(current);


Vec3 p1=Vec3(current.size.x*0.2,current.size.y*-0.5,current.size.z*1.2);
Vec3 rsize=Vec3(current.size.x*0.6,0,0.3);
Vec3 p3=p1+rsize;
Vec3 p2=p1+Vec3(rsize.x,0,0);
Vec3 p4=p1+Vec3(0,0,rsize.z);
double pcCharge=AGV(current).batteryLevel;
Color battCol=Color.fromPalette(pcCharge,"BatteryColor");
double r=battCol.r;
double g=battCol.g;
double b=battCol.b;
drawline(view,p1.x,p1.y,p1.z,p2.x,p2.y,p2.z,r,g,b);
drawline(view,p2.x,p2.y,p2.z,p3.x,p3.y,p3.z,r,g,b);
drawline(view,p3.x,p3.y,p3.z,p4.x,p4.y,p4.z,r,g,b);
drawline(view,p4.x,p4.y,p4.z,p1.x,p1.y,p1.z,r,g,b);
drawrectangle(p1.x,p1.y,p1.z,rsize.x*pcCharge/100,rsize.z,-90,0,0,255*r,255*g,255*b,1);
drawtoobjectscale(current);&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1701263546092.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1519374iCDD794961867F241/image-size/large?v=v2&amp;amp;px=999" role="button" title="1701263546092.png" alt="1701263546092.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1694525518050.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1519375i3622708E059418B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="1694525518050.png" alt="1694525518050.png" /&gt;&lt;/span&gt;&lt;P&gt;The code uses a color pallet:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1701263573333.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1519376iF1BB3FB7966BB828/image-size/large?v=v2&amp;amp;px=999" role="button" title="1701263573333.png" alt="1701263573333.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Example model:&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/76583-agvbatteryindicator.fsm" target="_blank"&gt;AGVbatteryIndicator.fsm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 12 Sep 2023 13:33:46 GMT</pubDate>
    <dc:creator>jason_lightfoot_adsk</dc:creator>
    <dc:date>2023-09-12T13:33:46Z</dc:date>
    <item>
      <title>How do I make a AGV level battery display?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-make-a-agv-level-battery-display/m-p/13576002#M75179</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 21.1.5 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;I would like to make a display whith shows the battery level of AGV, I would like that display stayed in side of park point. I looked for some similar project, but I dont find or I cant open de file because de version. &lt;/P&gt;
 &lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/73460-modelo-situacao-agv-elevador.fsm" target="_blank"&gt;Modelo situação AGV elevador.fsm&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Sep 2023 00:34:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-make-a-agv-level-battery-display/m-p/13576002#M75179</guid>
      <dc:creator>jonmaraf1VAKNE</dc:creator>
      <dc:date>2023-09-11T00:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make a AGV level battery display?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-make-a-agv-level-battery-display/m-p/13576003#M75180</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;You can use a Text object to display the battery level. You only need a reference to the AGV, which you could get by setting up a pointer label on the text object.&lt;/P&gt;&lt;P&gt;You read the battery level through "AGV(reference).batteryLevel". To have the text show this value, convert it to a string and assing it to the "textnode" treenode variable in the &lt;EM&gt;Text Display&lt;/EM&gt; code.&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/73471-modelo-situacao-agv-elevador-fm.fsm" target="_blank"&gt;modelo-situacao-agv-elevador-fm.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Sep 2023 06:03:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-make-a-agv-level-battery-display/m-p/13576003#M75180</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2023-09-11T06:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make a AGV level battery display?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-make-a-agv-level-battery-display/m-p/13576004#M75181</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Thank you!
&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Sep 2023 22:34:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-make-a-agv-level-battery-display/m-p/13576004#M75181</guid>
      <dc:creator>jonmaraf1VAKNE</dc:creator>
      <dc:date>2023-09-11T22:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make a AGV level battery display?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-make-a-agv-level-battery-display/m-p/13576005#M75182</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Here's some battery level indicator draw code for the agv object (for those finding this post from the title but wanting a graphical representation):&lt;/P&gt;&lt;PRE&gt;// If this function returns a true, the default draw code of the object will not be executed.
drawtomodelscale(current);


Vec3 p1=Vec3(current.size.x*0.2,current.size.y*-0.5,current.size.z*1.2);
Vec3 rsize=Vec3(current.size.x*0.6,0,0.3);
Vec3 p3=p1+rsize;
Vec3 p2=p1+Vec3(rsize.x,0,0);
Vec3 p4=p1+Vec3(0,0,rsize.z);
double pcCharge=AGV(current).batteryLevel;
Color battCol=Color.fromPalette(pcCharge,"BatteryColor");
double r=battCol.r;
double g=battCol.g;
double b=battCol.b;
drawline(view,p1.x,p1.y,p1.z,p2.x,p2.y,p2.z,r,g,b);
drawline(view,p2.x,p2.y,p2.z,p3.x,p3.y,p3.z,r,g,b);
drawline(view,p3.x,p3.y,p3.z,p4.x,p4.y,p4.z,r,g,b);
drawline(view,p4.x,p4.y,p4.z,p1.x,p1.y,p1.z,r,g,b);
drawrectangle(p1.x,p1.y,p1.z,rsize.x*pcCharge/100,rsize.z,-90,0,0,255*r,255*g,255*b,1);
drawtoobjectscale(current);&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1701263546092.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1519374iCDD794961867F241/image-size/large?v=v2&amp;amp;px=999" role="button" title="1701263546092.png" alt="1701263546092.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1694525518050.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1519375i3622708E059418B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="1694525518050.png" alt="1694525518050.png" /&gt;&lt;/span&gt;&lt;P&gt;The code uses a color pallet:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1701263573333.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1519376iF1BB3FB7966BB828/image-size/large?v=v2&amp;amp;px=999" role="button" title="1701263573333.png" alt="1701263573333.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Example model:&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/76583-agvbatteryindicator.fsm" target="_blank"&gt;AGVbatteryIndicator.fsm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 12 Sep 2023 13:33:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-do-i-make-a-agv-level-battery-display/m-p/13576005#M75182</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-09-12T13:33:46Z</dc:date>
    </item>
  </channel>
</rss>

