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

Method export_bcfxml

src/ifcclash/ifcclash/ifcclash.py:225–243  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

223 self.export_json()
224
225 def export_bcfxml(self) -> None:
226 from bcf.v2.bcfxml import BcfXml
227
228 for i, clash_set in enumerate(self.clash_sets):
229 bcfxml = BcfXml.create_new(clash_set["name"])
230 for clash in clash_set["clashes"].values():
231 title = f'{clash["a_ifc_class"]}/{clash["a_name"]} and {clash["b_ifc_class"]}/{clash["b_name"]}'
232 topic = bcfxml.add_topic(title, title, "IfcClash")
233 viewpoint = topic.add_viewpoint_from_point_and_guids(
234 np.array(clash["p1"]),
235 clash["a_global_id"],
236 clash["b_global_id"],
237 )
238 snapshot = self.get_viewpoint_snapshot(viewpoint)
239 if snapshot:
240 topic.markup.viewpoints[0].snapshot = snapshot[0]
241 viewpoint.snapshot = snapshot[1]
242 suffix = f".{i}" if i else ""
243 bcfxml.save(f"{self.settings.output}{suffix}")
244
245 def get_viewpoint_snapshot(self, viewpoint) -> Union[None, tuple[str, bytes]]:
246 # Possible to overload this function in a GUI application if used as a library.

Callers 1

exportMethod · 0.95

Calls 6

valuesMethod · 0.80
create_newMethod · 0.45
add_topicMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected