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

Method save

src/bcf/bcf/v2/bcfxml.py:194–205  ·  view source on GitHub ↗

Save the BCF file to the given filename.

(self, filename: Optional[Path] = None, keep_open: bool = False)

Source from the content-addressed store, hash-verified

192 return instance
193
194 def save(self, filename: Optional[Path] = None, keep_open: bool = False) -> None:
195 """Save the BCF file to the given filename."""
196 if not filename and not self._filename:
197 raise ValueError("No file name specified, cannot save BCF file.")
198 if filename:
199 self._filename = filename
200 with InMemoryZipFile(self._filename) as bcf_zip:
201 self._save_project(bcf_zip)
202 self._save_version(bcf_zip)
203 self._save_topics(bcf_zip)
204 if keep_open:
205 self._zip_file = self._load_zip_file()
206
207 def _save_project(self, destination_zip: ZipFileInterface) -> None:
208 self._smart_save_xml(destination_zip, self._project_info, "project.bcfp")

Callers 15

save_projectMethod · 0.95
test_bcf_roundtripFunction · 0.45
test_bcf_edit_saveasFunction · 0.45
test_bcf_editFunction · 0.45
test_save_no_filenameFunction · 0.45
test_save_keep_openFunction · 0.45
test_massive_bcfFunction · 0.45
test_bcf_roundtripFunction · 0.45
test_bcf_edit_saveasFunction · 0.45
test_bcf_editFunction · 0.45

Calls 5

_save_projectMethod · 0.95
_save_versionMethod · 0.95
_save_topicsMethod · 0.95
_load_zip_fileMethod · 0.95
InMemoryZipFileClass · 0.90

Tested by 14

test_bcf_roundtripFunction · 0.36
test_bcf_edit_saveasFunction · 0.36
test_bcf_editFunction · 0.36
test_save_no_filenameFunction · 0.36
test_save_keep_openFunction · 0.36
test_massive_bcfFunction · 0.36
test_bcf_roundtripFunction · 0.36
test_bcf_edit_saveasFunction · 0.36
test_bcf_editFunction · 0.36
test_save_no_filenameFunction · 0.36