topic

Module Contents

topic.extract_file(topic: TopicHandler, entity: bcf.agnostic.model.HeaderFile | bcf.agnostic.model.BimSnippet | bcf.agnostic.model.DocumentReference | bcf.agnostic.model.BitMap, bcfxml: bcf.v2.bcfxml.BcfXml | bcf.v3.bcfxml.BcfXml | None = None, outfile: pathlib.Path | None = None) pathlib.Path | str | None

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.

Parameters:
  • entity – The entity with a file reference to extract

  • outfile – If provided, save the header file to that location. Otherwise, a temporary directory is created and the filename is derived from the header’s original filename.

  • bcfxml – The BCF XML file to use for resolving document references files. Required only for BCF v3 document references (in BCF v3 internal documents are stored at BCF root, not in the topic).

Returns:

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

topic.TopicHandler