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 02-06-2008
Iulian Marin Ion Iulian Marin Ion is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 14
Downloads: 53
Uploads: 0
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 155
Iulian Marin Ion is on a distinguished road
Default Access to the tree variables

1. reservoir is added to the model.
2. add new user event activate at reset or at time moment very close to reset (let's say time=2)
3. the above mentioned user event contain one line only which is:
setnodenum(node("/Reservoir>variables/curcontent",model()),3000); The aim is to initialize the content of the reservoir with a certain quantity (the maximum level was defined to 10,000);
4. the above line has no efect
5. if launching this line from the script window the variable is set to the expected value;
6. I guess that I am doing something wrong within the script or I am not accessing the right variable. Any advice on this matter?
The Following User Says Thank You to Iulian Marin Ion For This Useful Post:
shafizad (08-09-2010)
  #2  
Old 02-06-2008
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

Iulian,

In my case it is working if I choose reset time for the User Event of e.g. 1 s.
If you say your code is working in the script, everything seems to be right with your code.

That it is not working with the User Event on Reset is in my eyes, because first the User Event is executed on Reset and afterwards the Reset of the object itself. So it is overwritten.
Maybe I am wrong, but this would be my explanation.

What you could also do is to put this code in the Reset of the object and check what is happening than. I tried it in my model and it is work too.

So I have no idea, why it is not working in your case.

Anyway, hopefully I was able to give you at least some hints.

Take care
tom the (A)tom
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
  #3  
Old 02-06-2008
Iulian Marin Ion Iulian Marin Ion is offline
Flexsim User
 
Join Date: Aug 2007
Posts: 14
Downloads: 53
Uploads: 0
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 155
Iulian Marin Ion is on a distinguished road
Default

Hy Tom,

Thank you very much. What you say it is corect. The reset for the objct it is applied after the reset of the model and put back the variable to zero.

If puting the script line to the Object Reset Triger it is fine and the problem is solved. I will pay more atention now to event succession.

I was wrong when saying that at User Event different than 0 is also not working. If user event is different than 0 the code is also working from the User Event.

Iulian


Thread Thread Starter Forum Replies Last Post
The nodes in active view tree don't have unique names. Tom David Gripes and Goodies 7 01-31-2013 07:01 AM
Can we still access old Flexsim Community Forum? AlanZhang Q&A 5 01-02-2008 10:50 AM
GUI & linked variables Iulian Marin Ion Q&A 2 11-27-2007 10:23 PM


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.