Skip to content

Open or switch projects

Keep opening and switching in the application shell or batch runner. An operation that reads walls or writes properties should receive a client for an already chosen project.

Open a project from saved identity

open_project starts Archicad using executable and project information from a saved header. Create the JSON file as described in saved projects.

The following opens that project in a new Archicad process. It can show dialogs and raises if the project is already open:

import json
from pathlib import Path
from multiconn_archicad import ConnHeader, MultiConn

conn = MultiConn()
saved_data = json.loads(Path("project.json").read_text(encoding="utf-8"))
target = ConnHeader.from_dict(saved_data)
port = conn.open_project.from_header(target)
print(f"Opened at port: {port}")

Pass demo=True to request demo mode. For teamwork projects, supply credentials using open_project.with_teamwork_credentials(target, credentials), where credentials is a TeamworkCredentials record. See saved projects.

To look for an already-running instance matching saved identity, use conn.find_archicad.from_header(target). It returns a matching port or None.

Switch a running instance to another solo project

Switching changes the project open in that instance. Finish current work and handle unsaved changes before doing it. Teamwork switching is not supported by this action; use the opening workflow instead.

from pathlib import Path
from multiconn_archicad import MultiConn, Port

conn = MultiConn()
new_path = Path("C:/Projects/Next.pln")  # Replace with your target project file.
header = conn.switch_project.from_path(
    original_port=Port(19723),  # Replace with the running instance's port.
    new_path=new_path,
)

Alternatively, switch_project.from_header(original_port=..., new_header=...) uses a header describing the target solo project. The switch returns the newly managed header. Check its readiness and obtain clients from it for the next run; do not reuse old project metadata, property IDs, or operation clients.

Expect application-specific dialogs

Missing libraries, licenses, and project state can interrupt unattended work. See Windows dialog handling. The library does not decide whether your application should save edits or retry a failed operation.