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 |
#1
|
|||
|
|||
which is better way To deal with this problem?
if i want to change the length of item dynamically In a period of time.
the first way , i can senddelaymessage in a short time (for example 0.25s)to change the the length of item In that period of time. the second way, i can use custom draw code to to change the length of item by simlation time i think the second one is better,because message is event.but other people do not agree . so i want to know which a higher efficiency for run speed |
#2
|
|||
|
|||
Without context this is hard to answer as there may be other things I'd worry about, for example if you're changing the length of an item as it travels down a conveyor . However generally I think I'd say the following:
You shouldn't really depend on the draw code for anything, since you may want to run with no views open for speed - and in this case the draw code will not be called. OnDraw would still be useful for watching something expand in size as a function of time with the view open. You can calculate the size as a simple linear function or even use kinematics to create a more complex progression over time. You would normally create an event/message for the end of the expansion/contraction where you set the size, and use draw code to draw it smoothly between the start and finish event. If the resizing is part of a process that can be interrupted (failure or preemption) then I'd consider using a BasicFR for the process since it can detect the stop and pause a kinematic or adjust your manual calculation. Another option for objects, if the resizing is independant of any other events, is to use the new animator feature in version 5. |
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with installation (new problem) | David Chan | Installation | 2 | 03-13-2009 10:41 AM |