Core API
One object model for projects, models, elements, tasks, links, calendars, resources, costs, simulation, viewer, clashes and video.
Drive Tectra from your own tools, the way Revit and Rhino can be scripted. The API runs on your own computer, is off by default, and only answers calls that carry one of your company's keys.
One object model for projects, models, elements, tasks, links, calendars, resources, costs, simulation, viewer, clashes and video.
Add buttons, panels, rules, importers and reports inside Tectra. Each plugin declares its permissions.
REST and live events on 127.0.0.1, with client libraries for Python and .NET first, then JavaScript.
Open Tectra and go to View › Extensions.
Switch on Local API. Tectra starts listening on http://127.0.0.1:47100/v1. Nothing is reachable from other computers.
Leave Tectra open while your scripts run.
Create a key in View › Extensions › API keys. The key is shown once, so store it in your password manager or an environment variable such as TECTRA_KEY. Each key belongs to one company database.
| Scope | Allows |
|---|---|
| read | Read projects, tasks, links, costs and KPIs |
| write | Change tasks and links, import schedules, run auto-link |
| render | Screenshots and video export |
| admin | Manage keys and plugins |
Send the key in the Authorization header on every call. Remove a key at any time and every script using it stops working at once.
Install the client library.
pip install tectraConnect. The client reads the key from the environment.
import os
from tectra import Client
t = Client(api_key=os.environ["TECTRA_KEY"])
for p in t.projects.list():
print(p.id, p.name)Read tasks.
project = t.projects.get("Tower A")
late = [x for x in project.tasks.list() if x.finish_variance_days > 0]
print(len(late), "activities are late")A complete script that imports the weekly P6 update, reads earned value and renders a video for the client.
Import this week's update. Links to the model are kept.
project.schedule.import_file("updates/week-12.xer")Link anything new with your saved template.
result = project.autolink(template="Concrete frame", min_score=0.8)
print(result.linked, "new links,", result.to_review, "to review")Read earned value at the data date.
kpi = project.evm(date=project.data_date)
print(f"SPI {kpi.spi:.2f} CPI {kpi.cpi:.2f} EAC {kpi.eac:,.0f}")Render the progress video.
project.renders.video(path="orbit", quality="1080p", out="week-12.mp4")Run it every week with Windows Task Scheduler or cron on macOS.
The same calls from any language. All paths start with http://127.0.0.1:47100.
| Method | Path | What it does |
|---|---|---|
| GET | /v1/projects | List the projects in the open company |
| GET | /v1/projects/{id}/tasks | Activities with dates, progress and links |
| PATCH | /v1/projects/{id}/tasks/{taskId} | Update dates or progress |
| POST | /v1/projects/{id}/links | Link elements by IFC GlobalId |
| POST | /v1/projects/{id}/schedule:import | Import an XER, XML or CSV update |
| POST | /v1/projects/{id}/autolink | Run auto-link with a template |
| GET | /v1/projects/{id}/evm?date= | Earned value and KPIs at a date |
| POST | /v1/projects/{id}/renders | Render a screenshot or MP4 |
curl -H "Authorization: Bearer $TECTRA_KEY" http://127.0.0.1:47100/v1/projectsOpen a WebSocket to /v1/events to hear when a task changes, the date changes in the viewer, or a render finishes.
for event in t.events.stream(["task.changed", "render.finished"]):
print(event.type, event.data)A plugin is a folder with a tectra-plugin.json manifest and your code. It can add a ribbon button, a side panel, auto-link rules, an importer or a report. Tectra shows the permissions a plugin asks for when you install it.
{
"name": "Concrete pour report",
"version": "1.0.0",
"permissions": ["read", "render"],
"ribbon": { "tab": "Output", "button": "Pour report", "run": "report.py" }
}The API is being built now. Names and paths may still change before release. Download Tectra and tick "Email me when the API is released" to hear first.
Free for Windows and macOS. Includes a demo building with its schedule.