question

Liam J3 avatar image
0 Likes"
Liam J3 asked Liam J3 commented

after rackrestoreitem(), creationtime of flowitem is changed

question1-rackrestoreitem-creationtime-of-flowitem.fsm

After executing rackrestoreitem() command, the creationtime value of the flowitem is changed.
Would’t it be appropriate to keep the old creationtime value without changing it?
That's my opinion.

FlexSim 16.0.9
rackrestoreitem
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Braydn T avatar image
1 Like"
Braydn T answered Liam J3 commented

Hey @Liam J3

rackrestoreitem() does not actually "restore" an item. It just creates a new item in whatever area you specify. FlexSim does not save the information of deleted items.

Since the new item does not have a reference to the deleted item, its creation time is whenever the command was called. This time is accessible in the tree for that item though, so if you save the creation time of the object that is going to be deleted before deletion, you can set the newly created object's creation time by creating a global variable and then using code like this.

Note: The global variable will be called itemCreation, and the item will be a called Sphere1, and will be located in Rack1.

Before deletion, I assign the global variable:

itemCreation = stats_creationtime(model().find("Rack1").find("Sphere1")).value;

and then when I create the new item, I assign it like this:

stats_creationtime(model().find("Rack1").find("Sphere1")).value = itemCreation;

I hope this answers your question! Please tag me @Braydn T if you need any more clarification.

· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Liam J3 avatar image Liam J3 commented ·

@Braydn T, @Joseph Gillespie

I think as follows.
- rackrecycleitem() does moving flowitem into flowitem bin.
- rackrecycleitem() does not destory flowitem.
- rackrestoreitem() does moving flowitem from flowitem bin.
and the moved flowitem is the last item of flowitem bin.

I think that when rackrestoreitem() is called flexsim engine changes the creationtime internally.
Please refer to the following link.
https://answers.flexsim.com/questions/67781/rackrestoreitem-and-restored-flowitem.html

0 Likes 0 ·
Joseph Gillespie avatar image Joseph Gillespie Liam J3 commented ·

@Liam J3

Do you have a question about something you mentioned here? I'm not sure what you would like us to help you with.

0 Likes 0 ·
Liam J3 avatar image Liam J3 Joseph Gillespie commented ·

No further questions. I wanted to post this at FlexSim > Development space,
but this was posted at Software & Simulation Questions.
Thank you.

0 Likes 0 ·