AnyLogic 9
Expand
Font size

Properties

In AnyLogic 9, the Properties section is docked to the right side of the model editor workspace and displays the properties of the currently selected element. If no elements are selected, the properties of the currently selected agent are displayed.

AnyLogic 9: The Properties viewProperties of the PedSource block

The properties of an element are organized in groups, which you can expand or collapse as you see fit.

When you change the value of a property, that property is highlighted with a vertical blue line.

Sometimes, elements have properties that cannot be left unspecified, otherwise an error will occur when you try to run the model. Such properties are marked by a vertical red line to alert you.

Referring to model elements

During model development, you often need to refer to a markup element from the properties of a block. The model editor in AnyLogic 9 supports all familiar options, such as selecting an element from the list of existing elements or selecting the element on canvas, which you can access from the property edit menu.

Property edit menu

The list of existing elements is available from the menu that appears when you click on the property:

AnyLogic 9: The list of existing elementsProperty edit menu opened from Appears at property

To select the element on the canvas, either use the button next to the property, or use the Select on canvas command from the property edit menu.

Creating new elements from properties

Sometimes you need to reference an element that you have not yet created. In this case, you can create a new element directly from the library block properties: you can draw target lines, pipes, and nodes, among others.

To create a new element from properties

  1. Click in the property field where you want to specify the markup element.
  2. In the property edit menu that appears, select Create new. You will automatically switch to the drawing mode.
  3. Draw the element on the canvas. When you are finished drawing, the name of the element appears in the property field.
  4. If you change your mind and do not want to create a new element, press Esc on your keyboard or click the AnyLogic: The pencil icon pencil icon next to the property once again.

You can create a new agent type in the same way, if necessary.

To create a new agent type from the properties

  1. Click in the property field. In the property edit menu that appears, select Create new agent type.
  2. In the menu that appears, specify the name, animation, and parameters (if necessary).
  3. Click the Create agent button to complete the process.
  4. If you change your mind and do not want to create a new element, click the AnyLogic: The cross icon cancel icon in the agent creation menu to exit.

Quick navigation to the referenced element

For quick navigation to the element from the properties, you can click next to the property. The graphical editor will center on the referenced element so you can select it.

Actions

The properties of elements and blocks can be quite extensive, especially actions, which are extension points where you can customize the behavior of a model element by writing your own code. To minimize clutter, we decided to let you choose which actions you want to see in the properties.

To add an action field

  1. In the Actions section of the properties click Add action.
  2. Select the action you need from the side menu.

    Add action menu

  3. Enter your code in the edit box of the action and continue developing your model.
    When typing the code, press Ctrl + Space (Cmd + Space or Ctrl + Shift + Space on macOS) to use the code completion assistant.

    Action field

To remove the empty action field that you no longer need, click AnyLogic: The minus icon next to the field.

How can we improve this article?