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

Method extract

src/bonsai/scripts/getIfcElements.py:36–50  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

34 self.filtered_elements = {}
35
36 def extract(self):
37 for element in self.root.findall("xs:element", self.ns):
38 print("Processing {}".format(element.attrib["name"]))
39 if not "substitutionGroup" in element.attrib or self.is_descendant_from_class(element, "uos"):
40 continue
41 data = {
42 "is_abstract": self.is_abstract(element),
43 "parent": element.attrib["substitutionGroup"].replace("ifc:", ""),
44 "attributes": self.get_attributes(element),
45 "complex_attributes": self.get_complex_attributes(element),
46 }
47 self.elements[element.attrib["name"]] = data
48 for filter in self.filters:
49 if self.is_descendant_from_class(element, filter) and not data["is_abstract"]:
50 self.filtered_elements.setdefault(filter, {})[element.attrib["name"]] = data
51
52 def export(self, filename):
53 final = {}

Callers 3

__call__Method · 0.45
getIfcElements.pyFile · 0.45
drawMethod · 0.45

Calls 7

is_abstractMethod · 0.95
get_attributesMethod · 0.95
printFunction · 0.85
formatMethod · 0.80
setdefaultMethod · 0.80

Tested by

no test coverage detected