I want to change the initial color of the fluid level display to white from the grey color(not the fluid color, which is green), is there a way to do that?
I want to change the initial color of the fluid level display to white from the grey color(not the fluid color, which is green), is there a way to do that?
Unfortunately the Fluid Level Display bar is hard coded to the grey color. However, by copying the draw code from the fluid object in the library, you can customize the color. Either place the following code directly in the On Draw Trigger of your object or create a User Command and call that from multiple objects. Be sure to return 1 at the end as this will cause the object to not draw its default level display.
fglPushMatrix(); glPushAttrib(GL_ENABLE_BIT); fglDisable(GL_TEXTURE_2D); double percentfull = 0; if (getvarnum(current, "maxcontent") > 0) percentfull = getvarnum(current, "curcontent") / getvarnum(current, "maxcontent"); double red = getcolorcomponent(current, 1); double green = getcolorcomponent(current, 2); double blue = getcolorcomponent(current, 3); double xlen = xsize(current) * getvarnum(current, "barsizex"); double ylen = ysize(current) * getvarnum(current, "barsizey"); double zlen = zsize(current) * getvarnum(current, "barsizez"); double barlen = zlen * percentfull; // Scale the world to model space fglScale(1 / xsize(current), 1 / ysize(current), 1 / zsize(current)); spacetranslate(getvarnum(current, "barlocx") * xsize(current), -getvarnum(current, "barlocz") * zsize(current), -getvarnum(current, "barlocy") * ysize(current)); spacerotate(getvarnum(current, "barrotx"), getvarnum(current, "barrotz"), getvarnum(current, "barroty")); drawcube(0, 0, 0, xlen, ylen, barlen, 0, 0, 0, red, green, blue); spacetranslate(0, 0, barlen); drawcube(0, 0, 0, xlen, ylen, zlen - barlen, 0, 0, 0, 255, 255, 255); //Change the last three components to your desired RGB color glPopAttrib(); fglPopMatrix(); return 1;
4 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