ATTENTION

This 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

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 09-20-2012
thill's Avatar
thill thill is offline
Travis Hill
 
Join Date: Feb 2008
Posts: 10
Downloads: 23
Uploads: 0
Thanks: 1
Thanked 4 Times in 2 Posts
Rep Power: 151
thill is on a distinguished road
Default Can event nodes like "OnTimerEvent" be flexscript?

I am playing around with the createevent command. This requires creating an OnTimerEvent node for the object which seems to always be a C++ node. FlexSim is object oriented and passes the data up the inheritance levels until one of the objects handles the event. I want my object to handle my special events and pass off all of the FlexSim ones.

I have found the C++ version of the code (below), but would like to build the OnTimerEvent node as Flexscript so I do not have to compile. Is this possible and if so what is the code to achieve it?

C++: o(FlexsimObject,c).OnTimerEvent(i,eventcode,eventd ata);
__________________
Travis Hill
Mississippi State University
  #2  
Old 09-20-2012
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: 773
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

Yes it can be flexscript on the instance - in which case i, c and eventcode will already exist when it's called (your eventcodes should be >100). Use the inheritcode() command to get Flexsim to perform it's normal operation for codes<100.

You can use EVENT_USEROPENINPUT and EVENT_USEROPENOUTPUT without setting up the timer event node.
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
thill (10-08-2012)

Tags
events, ontimerevent


Thread Thread Starter Forum Replies Last Post
"time" event Vic Li Q&A 4 06-12-2014 12:46 PM
How can you have a visual tool that has a mixture of "protected" and "no select"? thill Q&A 1 03-13-2012 12:44 AM
C++ function "ceil" in Flexscript Jörg Vogel Q&A 4 10-01-2008 10:17 AM
Is it possible one object comprised of the function of "combiner" and "separetor"? Vic Li Q&A 1 08-19-2008 04:41 AM
about "no select" and "show parameter window from side bar" qin tian Gripes and Goodies 3 03-21-2008 08:10 AM


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.