Skip to content

Create zone

Start from the script setup block, then add the snippet code below.

# ... script setup ...
TWIN_ID = "your-twin-id"
zone = api_post(
f"/v1/twin/{TWIN_ID}/zones",
{
"name": "Safety zone",
"volume": {
"boxes": [{
"center": {"x": 0.0, "y": 1.0, "z": 0.0},
"size": {"x": 2.0, "y": 2.0, "z": 2.0},
"rotation": {"x": 0.0, "y": 0.0, "z": 0.0, "w": 1.0},
}],
"prisms": [],
},
},
)
print(json.dumps(zone, indent=2))