AnyLogic
Expand
Font size

Using relative and absolute file paths

When working with external file resources in your model (Text file, Excel file, 3D object, CAD drawing, etc.), you can use relative or absolute paths to refer to these resources.

A relative path defines the location of the file relatively to the model folder. By default, it is used for the files that are stored inside the model folder (for example, 3D objects or CAD drawings). This allows you to easily distribute the model by copying the entire model folder: the resource links remain consistent.

An absolute path defines the absolute location of the file within the file system. It is commonly used for resources that serve as data sources for the model (for example, text or Excel files) and are stored outside of the model folder (for example, on a file server or in a shared folder).

You can set a file-based resource to use an absolute or a relative path.

To switch the file path between relative / absolute

  1. Open Resources folder in the model's tree structure and navigate to the properties of the external file resource:

  2. Click the button next to the File field and choose the required option from the drop-down list:

  3. The path will be switched to the selected type.

How can we improve this article?