Why a script, not a one-off
Ask the agent to write a script that produces the IFC, not to edit the file. A change is then a rerun: “move the window 0.5 m east” edits one number, and the whole model is rebuilt the same way. The script is also the record of every assumption the agent made.
Set up IfcOpenShell
Agents install their own tools; Cocobox does not install them. Tell the agent to use a virtual environment if IfcOpenShell is not there: python3 -m venv .venv && .venv/bin/pip install ifcopenshell. The API changed between versions, so let the agent check the version it got.
A minimal model
The spatial tree comes first: project, site, building, storey. Every element is then contained in a storey. This runs with IfcOpenShell 0.8:
import ifcopenshell, ifcopenshell.api, ifcopenshell.guid, hashlib
def gid(name): # the same name gives the same GlobalId on every rerun
return ifcopenshell.guid.compress(hashlib.md5(name.encode()).hexdigest())
run = ifcopenshell.api.run
model = run("project.create_file", version="IFC4")
project = run("root.create_entity", model, ifc_class="IfcProject", name="House")
run("unit.assign_unit", model)
model_ctx = run("context.add_context", model, context_type="Model")
body = run("context.add_context", model, context_type="Model",
context_identifier="Body", target_view="MODEL_VIEW", parent=model_ctx)
site = run("root.create_entity", model, ifc_class="IfcSite", name="Site")
building = run("root.create_entity", model, ifc_class="IfcBuilding", name="House")
storey = run("root.create_entity", model, ifc_class="IfcBuildingStorey", name="Ground floor")
run("aggregate.assign_object", model, relating_object=project, products=[site])
run("aggregate.assign_object", model, relating_object=site, products=[building])
run("aggregate.assign_object", model, relating_object=building, products=[storey])
wall = run("root.create_entity", model, ifc_class="IfcWall", name="South wall")
wall.GlobalId = gid("South wall")
rep = run("geometry.add_wall_representation", model, context=body,
length=15, height=2.6, thickness=0.2)
run("geometry.assign_representation", model, product=wall, representation=rep)
run("spatial.assign_container", model, relating_structure=storey, products=[wall])
model.write("architecture.ifc")
Rules that make agent-written IFC reliable
- Stable GlobalIds. Derive each GlobalId from the element's name, as above. A rerun then keeps them, so a comment or a clash report still points at the same element.
- Real openings. Doors and windows sit in openings cut in their walls, not in walls drawn around them.
- One file per discipline. Architecture, structure, plumbing, electrical and HVAC each in their own IFC, all on one shared grid and set of levels.
- Say what was assumed. Ask the agent to list every dimension it guessed. In Cocobox, agents flag what they assumed or did not test.
Review the model in the chat
With the free CAD and BIM review add-on on, an IFC the agent embeds in its answer opens in a 3D viewer in the chat. IFC2x3 and IFC4 are supported, and each element keeps its GlobalId, type and name. Orbit, measure between two points and cut a section on X, Y or Z.

Point at an element, say what changes
Click Comment, click a window, write “make it 600 mm wider”. The agent gets the file, the 3D point, the element's GlobalId, type and name, the camera and the section plane, much like a BCF viewpoint. When it writes the file again, the answer shows Before and After.

Several disciplines at once
For a whole building, one agent per discipline is faster and keeps files apart. A federation file lists them with the grid and levels, and the viewer shows them together. From a floor plan to BIM · The 2D plan to BIM workflow.