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

Method _save_document_references

src/bcf/bcf/v2/topic.py:235–244  ·  view source on GitHub ↗
(self, destination_zip: ZipFileInterface)

Source from the content-addressed store, hash-verified

233 destination_zip.writestr(real_path.at, self.reference_files[ref.reference])
234
235 def _save_document_references(self, destination_zip: ZipFileInterface) -> None:
236 if not self.topic:
237 return
238 for doc in self.topic.document_reference:
239 if doc.is_external or not doc.referenced_document:
240 continue
241 real_path = self._topic_dir
242 for path_part in doc.referenced_document.split("/"):
243 real_path = real_path.parent if path_part == ".." else real_path.joinpath(path_part)
244 destination_zip.writestr(real_path.at, self.document_references[doc.referenced_document])
245
246 def add_viewpoint(self, element: entity_instance) -> VisualizationInfoHandler:
247 """Add a viewpoint pointed at the placement of an IFC element to the topic.

Callers 1

saveMethod · 0.95

Calls 2

splitMethod · 0.80
writestrMethod · 0.45

Tested by

no test coverage detected