set BCF view
set-bcf-viewSet an open IFC viewer's view state by applying a BCF/BCFZIP viewpoint from a local path or generated download URL.
Instructions
Set the view state in the already-open local IFC viewer by applying a BCF/BCFZIP viewpoint file. Pass either a local BCF/BCFZIP file path or a generated BCF download URL from run Python saved_files. This tool does not show/load IFC files; use show-ifc-file for that. It should not open a new browser tab and should not use browser automation. To generate a BCFZIP with run-python, write a .bcfzip file, then call set-bcf-view with saved_files[0].url:
from uuid import uuid4
import ifcopenshell
from bcf.v3 import model as mdl
from bcf.v3.bcfxml import BcfXml
from bcf.v3.visinfo import VisualizationInfoHandler
model = ifcopenshell.open("sample.ifc")
gid = model.by_type("IfcWall")[0].GlobalId
component = mdl.Component(ifc_guid=gid)
visinfo = mdl.VisualizationInfo(
guid=str(uuid4()),
components=mdl.Components(
selection=mdl.ComponentSelection(component=[component]),
visibility=mdl.ComponentVisibility(
default_visibility=False,
exceptions=mdl.ComponentVisibilityExceptions(component=[component]),
),
),
)
bcf = BcfXml.create_new(project_name="IFC MCP")
topic = bcf.add_topic("Review wall", "Review wall", "ifc-mcp", topic_type="Issue", topic_status="Open")
topic.add_visinfo_handler(VisualizationInfoHandler(visinfo))
bcf_path = "view.bcfzip"
bcf.save(bcf_path)
print(str(bcf_path))Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bcf_path | Yes | Local BCF/BCFZIP file path, or a generated BCF download URL from run Python saved_files, to apply in the viewer. |