View Single Post
  #11  
Old 05-04-2016
Ben Wilson's Avatar
Ben Wilson Ben Wilson is offline
Flexsim Consultant, Super Moderator
 
Join Date: Jul 2007
Posts: 82
Downloads: 352
Uploads: 6
Thanks: 30
Thanked 159 Times in 43 Posts
Rep Power: 250
Ben Wilson is a glorious beacon of lightBen Wilson is a glorious beacon of lightBen Wilson is a glorious beacon of lightBen Wilson is a glorious beacon of lightBen Wilson is a glorious beacon of light
Default

Jing Chen included a sample model in the post above.

Quote:
The approach I use to solve this problem is the code in Custom Draw trigger.
As of FlexSim 7.7, this method no longer works.

In the 7.7 release, many graphics improvements were added to speed up the drawing time. One of the changes was to cache as much as possible in the scene about to be drawn. The item positions on the ASRS are now cached before the draw trigger fires, and thus, the draw trigger no longer is able to effect location changes on the items.

The work around is to include a custom OnPreDraw node on the ASRS. In the attached example model, an OnPreDraw node has been added to the ASRS under >behaviour/eventfunctions/OnPreDraw.

The code first calls inheritcode() to run the ASRS's standard OnPreDraw code, since this local OnPreDraw overrides the ASRS class object's default OnPreDraw, yet we still want that default code to fire.

Next we include our custom positioning script to position the items on the ASRS in our desired locations.
Attached Files
File Type: fsm ASRS_stack_horizontally_7.7.fsm (18.9 KB, 632 views)
Reply With Quote
The Following 8 Users Say Thank You to Ben Wilson For This Useful Post:
Agnieszka Pacynko (09-06-2016), arunkrmahadeva (05-04-2016), Axel Kohonen (05-08-2016), Jing Chen (05-04-2016), Jörg Vogel (05-04-2016), Kris Geisberger (05-04-2016), Phil BoBo (05-04-2016), Steven Hamoen (05-04-2016)