mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 22:11:36 +00:00
added boolean restriction
This commit is contained in:
@@ -218,6 +218,9 @@ class restriction:
|
|||||||
elif n.nodeType == n.ELEMENT_NODE and n.tagName.endswith("pattern"):
|
elif n.nodeType == n.ELEMENT_NODE and n.tagName.endswith("pattern"):
|
||||||
self.options.append(n.getAttribute("value"))
|
self.options.append(n.getAttribute("value"))
|
||||||
self.type = "pattern"
|
self.type = "pattern"
|
||||||
|
elif n.nodeType == n.ELEMENT_NODE and n.tagName.endswith("boolean"):
|
||||||
|
self.options.append(n.getAttribute("value").capitalize())
|
||||||
|
self.type = "boolean"
|
||||||
|
|
||||||
# "Given an instance with %(applicability)s\nWe expect %(requirements)s" % self.__dict__
|
# "Given an instance with %(applicability)s\nWe expect %(requirements)s" % self.__dict__
|
||||||
|
|
||||||
@@ -234,7 +237,8 @@ class restriction:
|
|||||||
return "of type %s with a length of %s" % (self.restriction_on, self.options[0])
|
return "of type %s with a length of %s" % (self.restriction_on, self.options[0])
|
||||||
elif self.type == "pattern":
|
elif self.type == "pattern":
|
||||||
return "of type %s respecting pattern %s" % (self.restriction_on, self.options[0])
|
return "of type %s respecting pattern %s" % (self.restriction_on, self.options[0])
|
||||||
|
elif self.type == "boolean":
|
||||||
|
return "of type %s set to %s" % (self.restriction_on, self.options[0])
|
||||||
|
|
||||||
class specification:
|
class specification:
|
||||||
"""
|
"""
|
||||||
@@ -303,7 +307,7 @@ if __name__ == "__main__":
|
|||||||
logging.FileHandler(filename, mode='w')
|
logging.FileHandler(filename, mode='w')
|
||||||
|
|
||||||
# ids_file = ids(sys.argv[1])
|
# ids_file = ids(sys.argv[1])
|
||||||
ids_file = ids(r"C:\Users\artom\Desktop\Code\IFC sandbox\IDS, MVDxml samples\IDS_test_1.xml")
|
ids_file = ids(r"C:\Users\artom\Desktop\Code\IFC sandbox\IDS, MVDxml samples\IDS_test_2.xml")
|
||||||
# ifc_file = ifcopenshell.open(sys.argv[2])
|
# ifc_file = ifcopenshell.open(sys.argv[2])
|
||||||
ifc_file = ifcopenshell.open(r"C:\Users\artom\Desktop\Code\IFC sandbox\IFC samples\IFC Artur.ifc")
|
ifc_file = ifcopenshell.open(r"C:\Users\artom\Desktop\Code\IFC sandbox\IFC samples\IFC Artur.ifc")
|
||||||
# ifc_file = ifcopenshell.open(r"C:\Users\artom\Desktop\Code\IFC sandbox\IFC samples\IFC Schependomlaan.ifc")
|
# ifc_file = ifcopenshell.open(r"C:\Users\artom\Desktop\Code\IFC sandbox\IFC samples\IFC Schependomlaan.ifc")
|
||||||
|
|||||||
Reference in New Issue
Block a user