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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anylogic_design_time_api-8.9.7.tar.gz.
File metadata
- Download URL: anylogic_design_time_api-8.9.7.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
257729e82a61a51217ba05a05ee1733234ba3f5d84e3b7dc583d4f617a6d6788
|
|
| MD5 |
3f5f40c4f3c467449db2ae6accd7faf5
|
|
| BLAKE2b-256 |
5bd0fe2ed1fffb235f5025ade616355e369bcabfcc023a960bdb30d8a288f9f3
|
File details
Details for the file anylogic_design_time_api-8.9.7-py3-none-any.whl.
File metadata
- Download URL: anylogic_design_time_api-8.9.7-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a2784a860a249bed357217b7f9fea1a4caeb0455ca641585f5db414225d9966
|
|
| MD5 |
1821a94724ba7659881dd28a233e43de
|
|
| BLAKE2b-256 |
40171ab6a94fc7458c3dc5f0a2dd631a55dbc004f0c73e5ead12d4157c6d8371
|