BCF XML V2 Topic handler.

Module Contents

class bcf.v2.topic.TopicHandler(topic_dir: zipfile.Path | None = None, xml_handler: bcf.xml_parser.AbstractXmlParserSerializer | None = None)

BCF Topic and related objects handler.

property bim_snippet: bytes | None
property comments: list[bcf.v2.model.Comment]

Return the comments of the topic.

property document_references: dict[str, bytes]
property guid: str

Return the GUID of the topic.

property header: bcf.v2.model.Header | None

Return the header of the topic.

property markup: bcf.v2.model.Markup | None
property reference_files: dict[str, bytes]
property topic: bcf.v2.model.Topic

Return the Topic object.

property viewpoints: dict[str, bcf.v2.visinfo.VisualizationInfoHandler]
add_viewpoint(element: ifcopenshell.entity_instance) None

Add a viewpoint pointed at the placement of an IFC element to the topic.


element: The IFC element.

add_viewpoint_from_point_and_guids(position: numpy.typing.NDArray[numpy.float_], *guids: str) None

Add a viewpoint pointing at an XYZ point in space


position: the XYZ point in space guids: one or more element GlobalIds.

add_visinfo_handler(new_viewpoint: bcf.v2.visinfo.VisualizationInfoHandler) None
classmethod create_new(title: str, description: str, author: str, topic_type: str = '', topic_status: str = '', xml_handler: bcf.xml_parser.AbstractXmlParserSerializer | None = None) TopicHandler

Create a new BCF topic.


title: The title of the topic. description: The description of the topic. author: The author of the topic. topic_type: The type of the topic. topic_status: The status of the topic. xml_handler: The XML parser/serializer to use.


The BCF topic definition.

extract_file(entity, outfile: pathlib.Path | None = None) pathlib.Path

Extracts an element with a file into a temporary directory

These include header files, bim snippets, document references, and viewpoint bitmaps. External reference are not downloaded. Instead, the URI reference is returned.


The filepath of the extracted file. It may be a URL if the header file is external.

Return type:


save(destination_zip: bcf.inmemory_zipfile.ZipFileInterface) None

Save the topic to a BCF zip file.


bcf_zip: The BCF zip file to save to.