View Single Post
  #2  
Old 05-21-2010
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 769
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

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.
Reply With Quote