Q: Programmatically draw image in Anylogic Is there any way to programmatically draw images in Anylogic? Only method I found so far is to add Image element to project, specify its image from filesystem and then getting it from cache at runtime (for example getPresentation().getPanel().getImageCache().getCachedImage( this, "/wandering_elephants/", "Altitudes.PNG", 500, 500 );) and draw to it.
But this seems to be paint in the ass in case you need to create variable sized images. I have been looking for some Drawable element in palette, but it seems this basic functionality is missing.

A: You can use replicated rectangles. To change the number of replications, use a variable of type int named numberOfReplications. Stick that into the "Replication" property of your rectangle and you can change that variable dynamically.
cheers
