I went on a quest in search of a flowitem requiring the fewest number of attribute nodes possible, and decided to document my journey for the benefit of all.
The motivation for having a flowitem with fewer nodes is to reduce the RAM memory requirement for running large models. There is also a slight increase in run speed because the flowitem generation time is possibly decreased. The obvious negative is that you are giving up functionality by removing attributes.
Here is the smallest flowitem structure that I could come up with, and still be able to see the flowitems moving through my model (if you don't want to see the flowitems, then remove the shapeindex node, but I figure you usually want to at least see your flowitems).
In the current installation,
shapeindex 25 is textureplanup.wrl, but that could change. You can also use negative indexes of -1, -2, -3, or -4 for primitive shapes of a sphere, cylinder, cone or cube respectively, if you prefer an index that won't change with future installations, but these primitives have more polygons obviously than a plane.
Now I will start to explain some of the more important attributes (nodes) you may want to add back into the flowitem's object data tree depending on the functionality you desired. It is not necessary to put the attributes inside any other node in the tree unless otherwise indicated. You must give the attribute nodes either text or number data when I indicate. To add a node, simply click on the node (not name) of the node you want to insert after, and hit the
space bar. To add text data to a node, click the node and hit the
t key. To add number data, hit the
n key. After adding attributes, you need to select main menu option
Build>Build Flexscript before the attribute will be recognized by Flexsim.
- If you want to resize the flowitem and/or have it better positioned inside other objects, you will need to add the spatialsx, spatialsy and spatialsz attributes and give them number data.
- If you want the flowitem to rotate, you must add the spatialrx, spatialry or spatialrz attribute depending upon what axis (x,y or z) you want the flowitem to rotate around. Be sure to give the nodes number data.
- The flowitem will not follow the proper radius of a curved conveyor section unless you add the centroid attribute.
- If you want to define the 3D shape with a text path to an external file, then you must add the shape attribute, and give it text data, then type your path.
- If you want to apply texture using a 2D image associated with the flowitem then you will need to at least add the imageindexobject attribute, and give it number data with a proper index number. Keep in mind this texturing only works on specially prepared 3D files.
- If you need to track the time each flowitem enters the model, you must add the stats_creationtime attribute, and give it number data.
- If you will be using flowitem labels in your model, then you will need the labels attribute. The actual labels are subnodes of this attribute and should be given a name and either text or number data depending on the type of label you want.
- If you want to access a Properties window, add the guifocus attribute, give it text data and type in a valid path to a gui object of your choice in the VIEW tree.
- If you want to access a Parameters window, add the guifocusclass attribute, give it text data and type in a valid path to a gui object of your choice in the VIEW tree.
- If the flowitem will contain other flowitems, and you do not want them automatically resized to fit in the flowitem, then add the nochildscale attribute like the Pallet has.
- If you want the flowitem to have its own color, and not adopt the currently active color, you must add the color attribute. You must then add three subnodes to it representing the red, green and blue color components respectively. The color component nodes need number data and should be given a value between 0 and 1.
- Although it will increase memory usage, it may slightly increase run speed to add the noondraw and nopredraw attributes because they will supress triggers that get executed with each screen refresh of active view windows for all the flowitems in the model. The nodes must be given object data and a numeric value of 1.
- If you want to define your own 3D look using draw commands, add the OnDraw attribute, give it text data, write draw code, toggle node flexscript (right-click Build>Toggle Node as Flexscript), and be sure to rebuild flexscript whenever you modify the code. In your code, use c to refer to the flowitem, and use eventdata to refer to the view window. To keep the flexscript tree (i.e. the subnodes of the OnDraw node that is created after building) as small as possible, you should consider putting your draw code in a User Command, and then just call the command in the OnDraw node itself.
- If you're making a container type flowitem, and want to position the flowitems that enter the container by writing some code the way the Pallet flowitem does, then add the OnReceive attribute, give it text data, write your code, toggle the node as flexscript, and rebuild flexscript. In your code, use c to refer to the container flowitem, and use i to refer to the entering flowitem that triggered the OnReceive event.