Search code examples
collectionsshortcutanylogic

Collections Shortcut in Anylogic


In Anylogic I want to add a set of existing objects of a certain type to a collection so i can easily refer to them in code. This is easy when you have a few objects in the collection, But i am looking for a solution where there are lots more objects that can be easily selected either directly or using the Project browser.

Say for example i have a hundreds of nodes in my model that i can easily select either in the Projects browser or even selecting them otherwise, can i quickly add these to a collection, instead of adding them one by one?

(the question has repetitions because it cant be posted without it being longer)


Solution

  • While working in the canvas, you can just select all the objects, "right click" to show the drop down menu. There will be a option in the menu to create a collection that includes all the object you have selected. Is this what you need?