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

Method save

src/bcf/bcf/v3/topic.py:175–188  ·  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

173 return obj
174
175 def save(self, destination_zip: ZipFileInterface) -> None:
176 """
177 Save the topic to a BCF zip file.
178
179 Args:
180 bcf_zip: The BCF zip file to save to.
181 """
182 topic_dir = self.guid
183 # simulating directory creation (ZipFile in python < 3.11 doesn't have mkdir)
184 destination_zip.writestr(f"{topic_dir}/", "")
185 self._save_xml(destination_zip, self._markup, "markup.bcf")
186 self._save_viewpoints(destination_zip, topic_dir)
187 self._save_bim_snippet(destination_zip)
188 self._save_reference_files(destination_zip)
189
190 def _save_viewpoints(self, destination_zip: ZipFileInterface, topic_dir: str) -> None:
191 if not self.topic.viewpoints or not (viewpoints := self.topic.viewpoints.view_point):

Callers 1

_save_viewpointsMethod · 0.45

Calls 5

_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