Skip to main content

Create AnyLogic markup by code

Project description

AnyLogic Design-Time Python API

The AnyLogic Design-Time Python API allows you to programmatically modify an AnyLogic model while it is open in the graphical editor.
It provides the Python runtime with access to the model structure, allowing you to generate space markup automatically.

This package communicates with the AnyLogic editor using the built-in Graphical Editor API Connector, available in AnyLogic 8.9.7+.


Features

  • Connect to the AnyLogic editor using a secure one-time token
  • Create and configure model elements programmatically
  • Automatically generate data-driven layout structures
  • Access wrapper classes for AnyLogic objects (for example, Conveyor, Path, PointNode, TurnStation, Robot)

Installation

pip install anylogic_design_time_api

Requirements

  • AnyLogic 8.9.7 or later
  • Python 3.9+ (tested on Python 3.13)
  • Open port for API connector running inside AnyLogic (configurable)

When you start the connector from the AnyLogic toolbar, a dialog displays a connection token. Use this token in your Python script to attach to the editor.


Basic usage

from anylogic_design_time_api import *
from anylogic_design_time_api.generated import *

# Connect to the running AnyLogic editor
ws = Workspace("paste-your-token-here")

# Open the model
model = ws.getModel("My model")
agent = model.getAgent("Main")
level = agent.getLevels()[0]  # animation level where markup is created

# Create nodes
node1 = PointNode.create(level)
node2 = PointNode.create(level)
path = Path.create(level)

# Layout
node1.setX(100)
node1.setY(200)
node2.setX(300)
node2.setY(200)
path.setX(100)
path.setY(200)

# Define path geometry (relative to path position)
pathPoints = [0.0, 0.0, 0.0, 200.0, 0.0, 0.0]
pathPointList = Utils.createStraightPointsList(path, pathPoints)
path.setPointList(pathPointList)

# Connect network
path.setSource(node1)
path.setTarget(node2)

Documentation

Full documentation, including wrapper classes, raw functions, and an extended example, is available in the AnyLogic documentation.


License

© The AnyLogic Company.
Distributed for use with the AnyLogic simulation environment.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anylogic_design_time_api-8.9.9.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anylogic_design_time_api-8.9.9-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file anylogic_design_time_api-8.9.9.tar.gz.

File metadata

  • Download URL: anylogic_design_time_api-8.9.9.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for anylogic_design_time_api-8.9.9.tar.gz
Algorithm Hash digest
SHA256 7f0121b1d02a56f3860ac746470c6a6a7754e1f1060b89b51acd5cc80d0dbbb3
MD5 6119b1db93c544e66ef818f94ebf197d
BLAKE2b-256 56dd239bc23ed79b5b7f499362937dfc499b97d8213e2e5175127468d01ad831

See more details on using hashes here.

File details

Details for the file anylogic_design_time_api-8.9.9-py3-none-any.whl.

File metadata

File hashes

Hashes for anylogic_design_time_api-8.9.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f312bfad049374ae1593637d5073988148e594895f8a11f1dcbd71dee862e8cd
MD5 eca26f3292497d16a5fdc3235a26308b
BLAKE2b-256 2d14f1f9a0c284868c00417fc6bf69927fcfb0abb9c6984426aa9efc43bcbc76

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page