ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. 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. |
flexsim.com |
|
Downloads |
Flexsim Student Forum Forum for discussion for Flexsim Students using the Flexsim Textbook. |
#1
|
|||
|
|||
Multiple objects Released by one source.
Greeting,
It has been a while now since I've started trying to write a code in the source triggers to make it release several different objects (Both Box and Sphere for example) but It seems to be much more delicate than what I though. Does any one have a clue or a starting point? Thank you in advance. |
#2
|
|||
|
|||
If your boxes and spheres have different arrival rates or schedules then you would simply use two Source objects.
Otherwise (and if you want to write code) start by looking at the code behind the OnCreation (or OnExit) trigger called "Change 3D Shape". All you really need is: Code:
setname(shape(item),"_shape"); set(shapeindex(item), 3); Example: 40% Boxes, 60% Spheres Since querying whether the shape of an item is not as simple as looking at the itemtype, I will set the itemtype first then base the shape on it. Code:
int boxindex = getshapeindex("fs3d\\General\\Box.3ds"); int sphereindex = getshapeindex("fs3d\\General\\Sphere.3ds"); int thistype = bernoulli(40,1,2); setitemtype(item,thistype); setname(shape(item),"_shape"); if(getitemtype(item)==1) set(shapeindex(item), boxindex); else set(shapeindex(item), sphereindex); Another option for the shape indexes is to use a global variables and getshapeindex() OnReset of the model. Other threads on the topic: http://www.flexsim.com/community/for...read.php?t=217 http://www.flexsim.com/community/for...read.php?t=643 |
The Following User Says Thank You to Kris Geisberger For This Useful Post: | ||
Ayoub EL BOUCHTILI (02-23-2013) |
Thread | Thread Starter | Forum | Replies | Last Post |
Unable to highlight multiple objects | jspeece | Q&A | 2 | 09-23-2011 12:52 AM |
Creating a stacked bar chart for the states of multiple objects | Kris Geisberger | Tips and Tricks | 6 | 08-11-2011 09:40 PM |
Flexsim HC version 1.0 has been released | Bill Nordgren | FlexSim HC: Product Announcements | 0 | 07-06-2009 11:25 AM |
Pulling multiple objects | Roland Tainton | Q&A | 0 | 03-24-2009 06:05 AM |
Flexsim v4.32 is released | Anthony Johnson | Gripes and Goodies | 0 | 03-14-2008 09:01 AM |