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

Method export

src/bonsai/scripts/getIfcElements.py:52–57  ·  view source on GitHub ↗
(self, filename)

Source from the content-addressed store, hash-verified

50 self.filtered_elements.setdefault(filter, {})[element.attrib["name"]] = data
51
52 def export(self, filename):
53 final = {}
54 for filter in self.filters:
55 final.update(self.filtered_elements[filter])
56 with open(filename, "w") as file:
57 file.write(json.dumps(collections.OrderedDict(sorted(final.items())), indent=4))
58
59 def is_descendant_from_class(self, element, class_name):
60 if element is None or "substitutionGroup" not in element.attrib or "type" not in element.attrib:

Callers 1

getIfcElements.pyFile · 0.45

Calls 4

openFunction · 0.50
updateMethod · 0.45
writeMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected