This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.

Go Back   FlexSim Community Forum > FlexSim Software > Tips and Tricks

Tips and Tricks Share helpful modeling ideas

Old 11-22-2007
Cliff King's Avatar
Cliff King Cliff King is offline
Vice President Technical Services
Join Date: Jul 2007
Location: Utah
Posts: 272
Downloads: 158
Uploads: 14
Thanks: 102
Thanked 304 Times in 110 Posts
Rep Power: 412
Cliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud of
Default Customizing Flowitem Attributes - a quest for the flowitem with the fewest attributes

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).

Click image for larger version
Name:	MinFlowItem.jpg
Views:	427
Size:	10.7 KB
ID:	77

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.
  1. 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.
  2. 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.
  3. The flowitem will not follow the proper radius of a curved conveyor section unless you add the centroid attribute.
  4. 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.
  5. 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.
  6. If you need to track the time each flowitem enters the model, you must add the stats_creationtime attribute, and give it number data.
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. 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.
  13. 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.
  14. 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.

Last edited by Cliff King; 11-22-2007 at 08:58 PM. Reason: Embedded image
The Following 3 Users Say Thank You to Cliff King For This Useful Post:
Jay Chou (03-26-2013)

All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.