I am trying to animate the movement of vehicles over a path over time.
To do this, I’d need to keep something like a database of all vehicles containing their location, speed, acceleration and route for each vehicle and interpolate over time. The idea is to run a periodic script updating the position of each vehicle every, say, 1000 ms.
The data would internpolate from previous time increment to calculate new location/speed/acceleration. I have prepared a draft python node that would calculate new values between the two time increments.
The problem I have is that I am not sure where to store this data. If I try to keep it in a list and feed the output back into the input of the python node I get a cyclic reference! My other idea is to convert the data into a text element inside revit, and then convert the data back into a list and feed it into the function.This doesn’t work also. It would appear that once periodic running is enabled, ModelText.Text only reads the text once and doesn’t bother to update from Revit on subsequent periodic runs.
The only solution I can think of is to pre-calculate the position of all vehicles over time and then animate over this pre-prepared database of positions/times. But the I’d lose the interactivity of updating input data in real time (e.g. time in stop or max acceleration).
Any ideas how this could be achieved? Or is Dynamo/revit/python a completely wrong tool to attempt to do this?