Is there an expression to update an attribute on all objects inside a Container?

Skip to first unread message

Anthony Earl

Apr 25, 2024, 8:50:09 PMApr 25
to JaamSim Users Discussion Group
I've attached a trivial example to help express this question.

I've a model I'm working on that uses containers.  When an attribute on the container gets updated I would like to make a corresponding change to an attribute on each of its children.

I can't work out an expression to do that.

I know I'm able to make a copy of each of the children but just can't see how to update the items in the EntityList itself.

I know I can set these attributes when the children are first added to the container but in the more complex model I'm working on, that's not sufficient.

Any help would really be appreciated.


Paul McIver

Apr 26, 2024, 7:05:46 AMApr 26
to JaamSim Users Discussion Group
Asked pretty much the same question in an older post, programmatically assigning a value to to attributes of entities within a container.

Harry King

Apr 26, 2024, 12:28:26 PMApr 26
to JaamSim Users Discussion Group
The solution is given in my post under "Assign attribute to Entity on EntityContainer".


Reply all
Reply to author
0 new messages