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.
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.
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.
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 Text Display code.
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):
// 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);
The code uses a color pallet:
Example model:
15 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved