MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / save

Method save

src/bcf/bcf/v2/topic.py:187–201  ·  view source on GitHub ↗

Save the topic to a BCF zip file. Args: bcf_zip: The BCF zip file to save to.

(self, destination_zip: ZipFileInterface)

Source from the content-addressed store, hash-verified

185 return obj
186
187 def save(self, destination_zip: ZipFileInterface) -> None:
188 """
189 Save the topic to a BCF zip file.
190
191 Args:
192 bcf_zip: The BCF zip file to save to.
193 """
194 topic_dir = self.guid
195 # simulating directory creation (ZipFile in python < 3.11 doesn't have mkdir)
196 destination_zip.writestr(f"{topic_dir}/", "")
197 self._save_xml(destination_zip, self._markup, "markup.bcf")
198 self._save_viewpoints(destination_zip, topic_dir)
199 self._save_bim_snippet(destination_zip)
200 self._save_reference_files(destination_zip)
201 self._save_document_references(destination_zip)
202
203 def _save_viewpoints(self, destination_zip: ZipFileInterface, topic_dir: str) -> None:
204 if not self.markup or not (viewpoints := self.markup.viewpoints):

Callers 1

_save_viewpointsMethod · 0.45

Calls 6

_save_xmlMethod · 0.95
_save_viewpointsMethod · 0.95
_save_bim_snippetMethod · 0.95
_save_reference_filesMethod · 0.95
writestrMethod · 0.45

Tested by

no test coverage detected