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

Method _save_reference_files

src/bcf/bcf/v3/topic.py:209–220  ·  view source on GitHub ↗
(self, destination_zip: ZipFileInterface)

Source from the content-addressed store, hash-verified

207 destination_zip.writestr(f"{self.topic.guid}/{ref_filename}", self.bim_snippet)
208
209 def _save_reference_files(self, destination_zip: ZipFileInterface) -> None:
210 if not self.header:
211 return
212 if not self.header.files:
213 return
214 for ref in self.header.files.file:
215 if ref.is_external or not ref.reference:
216 continue
217 real_path = self._topic_dir
218 for path_part in ref.reference.split("/"):
219 real_path = real_path.parent if path_part == ".." else real_path.joinpath(path_part)
220 destination_zip.writestr(real_path.at, self.reference_files[ref.reference])
221
222 def add_viewpoint(self, element: entity_instance) -> VisualizationInfoHandler:
223 """

Callers 1

saveMethod · 0.95

Calls 2

splitMethod · 0.80
writestrMethod · 0.45

Tested by

no test coverage detected