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 10-03-2007
Lolke Koopmans's Avatar
Lolke Koopmans Lolke Koopmans is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Posts: 42
Downloads: 21
Uploads: 0
Thanks: 24
Thanked 14 Times in 10 Posts
Rep Power: 163
Lolke Koopmans is on a distinguished road
Default Model Startup Code

I am trying to find a way to execute code when I open my model.
The menu 'Model Startup Code' under Tools describes exactly what I am trying to do. However this code is executed after compile (as the gui tells me). Since we are not compiling anymore in Flexsim4 this code will never be executed.
Would it be possible to change the logic of this menu, so that it actually is executed at model startup? The code is already flexscript, so it should be possible?
If anyone knows how to execute code at startup, please let me know.

Thanks,
Lolke
  #2  
Old 10-03-2007
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

Lolke,

There is a thread called Start Flexsim and model from externally via a batch file under Technical Support / External Connection / Other Connections.

It is not exactly what you are looking for but it describes a way how to execute some code by using the StartupRT.txt.

I would think, that you want the code you like to execute save in your model and you do not want to change any external files.
So I agree it would be nice to have way to execute some code in your model without compile the model, like the Model Startup Code .

Maybe there is a way and we just do not know it .
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
  #3  
Old 10-03-2007
Cliff King's Avatar
Cliff King Cliff King is offline
Vice President Technical Services
 
Join Date: Jul 2007
Location: Utah
Posts: 272
Downloads: 158
Uploads: 14
Thanks: 102
Thanked 304 Times in 110 Posts
Rep Power: 412
Cliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud of
Default Model Startup Code is not a good title

We realize that Model Startup Code is not a good title and that it really should have been called Post Compiling Code or something like that. It is on our future development list to allow users to define Model Load Code (not sure this is what it will be called). For now, what I do is add a node in my model Tools folder, give it object data, add a node to its object data tree, give it text data, give the new node the name OnLoad, toggle the node flexscript, build flexscript, save model. Next time you load the model, any code you wrote in the OnLoad node's text data will execute.
  #4  
Old 10-03-2007
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

Cliff's suggestion should work, however, be aware that if you do it as he mentioned, the OnLoad code will fire whenever you load anything, not just your model. So the code will be executed when you load the model, but also if you, let's say, load a user library while the model is open, or if you load a tree file anywhere into the model, the OnLoad code will also be fired again at that point. As Cliff said, it's on our list to add a Model Load script that just fires when you open the model.
  #5  
Old 12-14-2007
Lolke Koopmans's Avatar
Lolke Koopmans Lolke Koopmans is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Posts: 42
Downloads: 21
Uploads: 0
Thanks: 24
Thanked 14 Times in 10 Posts
Rep Power: 163
Lolke Koopmans is on a distinguished road
Default

I have seen that the On Model Open trigger is added in the 4.3 version.
Thanks!



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.