File resources

When modeling in AnyLogic, you can utilize external file resources: text files, Excel files, images, 3D objects, CAD drawings, and Java files. The Projects view provides access to all external files related to the model via Resources folder situated at the bottom of the model's tree structure. The files are organized in subfolders by type. In case of complex objects, all nested files making up one object (for example, .jpg textures used in 3D objects or index files and dBASE tables comprising shape files) will be displayed individually in the corresponding subfolders.

If the model folder contains over 100 files, including the .alp files, the Resources folder in Projects view will display only those files that are referenced in the model.

The color of the file's name in the folder reflects the current state of this file:

File location

These external files can be stored either in the model's folder or at any external location.

The location of the file is indicated in the resource's Properties view. If the file is stored in the model's folder, the Path field will display the file's location relative to the model's folder. If the file is stored outside of the model's folder, the Path field will display the absolute path to the file's location in the file system. You can switch between relative and absolute paths as you see fit. You can copy the path to the file to clipboard directly from the Projects view by right-clicking the name of the file and selecting Copy Path to File command from the context menu.

To open the folder where the resource file is located, you have to right-click the name of the file in Projects view and select Show in System Explorer option from the context menu. If the file has been removed (the name of the file in the Projects view is highlighted in red), System Explorer will open a folder where the file has been stored previously. If the folder is unavailable, e.g. has been deleted, System Explorer will open the next available folder up the directory.

References from code

On model export or at saving the current model with a new name, AnyLogic, as a rule, only includes the file resources that are utilized in the model via palette elements, such as Text file, Image, etc. However, your model might also have sections of custom code with references to file resources that are otherwise not used in the model. To include such files on export, go to the file's Properties view and select Resource is referenced from user code option. You can also use this option to export the currently unutilized files that might prove to be useful later on.