teresimio123 Posted February 13, 2020 Share Posted February 13, 2020 Hi!! I want to know in which object (in this case filler) my container entity is when certain event occurs. Is there a way to access this info? Thank you so much! Teresita Link to comment Share on other sites More sharing options...
GFurtado Posted February 13, 2020 Share Posted February 13, 2020 (edited) ModelEntity.CurrentStation might help you. Alternatively: You could register the object in an ObjectReference state or its name in a string state, depending on what you want to do with this information. Edited February 13, 2020 by GFurtado Link to comment Share on other sites More sharing options...
teresimio123 Posted February 19, 2020 Author Share Posted February 19, 2020 Gustavo, how can I register ContainerEntity.CurrentStation as a string? As to write it in excel with excel write step afterwards. Thanks again! Link to comment Share on other sites More sharing options...
GFurtado Posted February 19, 2020 Share Posted February 19, 2020 ModelEntity.CurrentStation.Name Be aware that this will return an error in the case the entity is not at a station. Link to comment Share on other sites More sharing options...
GFurtado Posted February 19, 2020 Share Posted February 19, 2020 29 minutes ago, GFurtado said: ModelEntity.CurrentStation.Name Be aware that this will return an error in the case the entity is not at a station. Wait, actually this doesn't work. Check the attached model: Create a new ContainerEntity with a string state named whatever you like; Assign NewContainerEntity.NewStringState = Filler.Name when entering the filler. Use this expression any time you need the name of the last station that entity visited. Get Station Name.spfx Link to comment Share on other sites More sharing options...
teresimio123 Posted February 19, 2020 Author Share Posted February 19, 2020 Thanks Gustavo, actually what worked for me was ContainerEntity.Location.Parent.Name! Anyway thank you very much. I have another doubt which I think is far more complicated. I have two "streets" with a container entity moving moving along each of them. This streets have both fillers and emptiers, and I wish to write in excel every time a container entity goes from a filler to an emptier and how long that took. For example if my container on street 1 goes from filler_2 to emptier_6 I would like a row in excel with those 3 columns: starting filler, ending emptier and time between. I achieved this without problem for one of the streets (adding add on process triggers to all of the fillers and another for all of the emptiers). The thing is when I add this same processes to the emptiers/fillers of street 2, my excel goes crazy and obviously because of two reasons: the time I register to calculate time between is being updated in both streets every time a container goes out of an emptier, and exactly the same happens with the row that this 3 things have to be written in the excel. I don't know hoy I can manage to construct the variables time and row_count without them getting confused and hence my excel becoming useless. Thanks, again!!! Link to comment Share on other sites More sharing options...
GFurtado Posted February 24, 2020 Share Posted February 24, 2020 On 2/19/2020 at 3:34 PM, GFurtado said: Get Station Name.spfx 134.4 kB · 2 downloads I would suggest to expand this model I sent before by creating new states inside your ModelEntity. Two states when the entity leaves a station (one updates the station name and one updates the time it left). A state when the entity enters a station. Maybe another states registering how many rows in your sheet were written. The columns of your sheet would be ModelEnity.FromStation, ModelEntity.ToStation and (ModelEntity.TimeLeftStation - TimeNow). Let me know if you need help building this model. Link to comment Share on other sites More sharing options...
Recommended Posts