From 66d06270353d697e8d7a97a05b500ad94278032d Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Fri, 3 Feb 2023 21:18:06 +0100 Subject: [PATCH] Property names test case --- .../fixtures/rules/fail-wall-2-same-psets.ifc | 16 ++++++++++++++ .../test/fixtures/rules/generate_22.py | 21 +++++++++++++++++++ .../fixtures/rules/pass-wall-0-same-psets.ifc | 10 +++++++++ .../fixtures/rules/pass-wall-1-same-psets.ifc | 13 ++++++++++++ .../rules/pass-wall-different-psets.ifc | 16 ++++++++++++++ 5 files changed, 76 insertions(+) create mode 100644 src/ifcopenshell-python/test/fixtures/rules/fail-wall-2-same-psets.ifc create mode 100644 src/ifcopenshell-python/test/fixtures/rules/generate_22.py create mode 100644 src/ifcopenshell-python/test/fixtures/rules/pass-wall-0-same-psets.ifc create mode 100644 src/ifcopenshell-python/test/fixtures/rules/pass-wall-1-same-psets.ifc create mode 100644 src/ifcopenshell-python/test/fixtures/rules/pass-wall-different-psets.ifc diff --git a/src/ifcopenshell-python/test/fixtures/rules/fail-wall-2-same-psets.ifc b/src/ifcopenshell-python/test/fixtures/rules/fail-wall-2-same-psets.ifc new file mode 100644 index 0000000000..b7ef48adde --- /dev/null +++ b/src/ifcopenshell-python/test/fixtures/rules/fail-wall-2-same-psets.ifc @@ -0,0 +1,16 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1'); +FILE_NAME('','2023-02-03T21:16:13',(),(),'IfcOpenShell v0.7.0-07ee62eb9','IfcOpenShell v0.7.0-07ee62eb9',''); +FILE_SCHEMA(('IFC4')); +ENDSEC; +DATA; +#1=IFCWALL('1SjOSKeDn8KOLFOaEVy$oN',$,$,$,$,$,$,$,$); +#2=IFCPROPERTYSINGLEVALUE('LoadBearing',$,IFCBOOLEAN(.T.),$); +#3=IFCPROPERTYSET('24PUuhvvDBAAfpODs9iLMq',$,'Pset_WallCommon',$,(#2)); +#4=IFCRELDEFINESBYPROPERTIES('2S0SlVqz53ngyujVI74cbR',$,$,$,(#1),#3); +#5=IFCPROPERTYSINGLEVALUE('LoadBearing',$,IFCBOOLEAN(.T.),$); +#6=IFCPROPERTYSET('3uhaYX0B968xG1PXbJ$VVN',$,'Pset_WallCommon',$,(#5)); +#7=IFCRELDEFINESBYPROPERTIES('1Q1amHTX1FCBA3duuSyAUM',$,$,$,(#1),#6); +ENDSEC; +END-ISO-10303-21; diff --git a/src/ifcopenshell-python/test/fixtures/rules/generate_22.py b/src/ifcopenshell-python/test/fixtures/rules/generate_22.py new file mode 100644 index 0000000000..f6940def97 --- /dev/null +++ b/src/ifcopenshell-python/test/fixtures/rules/generate_22.py @@ -0,0 +1,21 @@ +import ifcopenshell + +for cnt in range(0,3): + f = ifcopenshell.file(schema="IFC4") + elem = f.createIfcWall(ifcopenshell.guid.new()) + for i in range(cnt): + f.createIfcRelDefinesByProperties(ifcopenshell.guid.new(), None, None, None, [elem], + f.createIfcPropertySet(ifcopenshell.guid.new(), None, 'Pset_WallCommon', None, [f.createIfcPropertySingleValue('LoadBearing', None, f.createIfcBoolean(True))]) + ) + f.write(f"{'pass' if cnt < 2 else 'fail'}-wall-{cnt}-same-psets.ifc") + + +f = ifcopenshell.file(schema="IFC4") +elem = f.createIfcWall(ifcopenshell.guid.new()) +f.createIfcRelDefinesByProperties(ifcopenshell.guid.new(), None, None, None, [elem], + f.createIfcPropertySet(ifcopenshell.guid.new(), None, 'Pset_WallCommon', None, [f.createIfcPropertySingleValue('LoadBearing', None, f.createIfcBoolean(True))]) +) +f.createIfcRelDefinesByProperties(ifcopenshell.guid.new(), None, None, None, [elem], + f.createIfcPropertySet(ifcopenshell.guid.new(), None, 'Custom', None, [f.createIfcPropertySingleValue('IsBeautiful', None, f.createIfcBoolean(True))]) +) +f.write(f"pass-wall-different-psets.ifc") \ No newline at end of file diff --git a/src/ifcopenshell-python/test/fixtures/rules/pass-wall-0-same-psets.ifc b/src/ifcopenshell-python/test/fixtures/rules/pass-wall-0-same-psets.ifc new file mode 100644 index 0000000000..50804ab1d4 --- /dev/null +++ b/src/ifcopenshell-python/test/fixtures/rules/pass-wall-0-same-psets.ifc @@ -0,0 +1,10 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1'); +FILE_NAME('','2023-02-03T21:16:13',(),(),'IfcOpenShell v0.7.0-07ee62eb9','IfcOpenShell v0.7.0-07ee62eb9',''); +FILE_SCHEMA(('IFC4')); +ENDSEC; +DATA; +#1=IFCWALL('1s4VK6VcTBufQtdjWi3ZIK',$,$,$,$,$,$,$,$); +ENDSEC; +END-ISO-10303-21; diff --git a/src/ifcopenshell-python/test/fixtures/rules/pass-wall-1-same-psets.ifc b/src/ifcopenshell-python/test/fixtures/rules/pass-wall-1-same-psets.ifc new file mode 100644 index 0000000000..4feb20c943 --- /dev/null +++ b/src/ifcopenshell-python/test/fixtures/rules/pass-wall-1-same-psets.ifc @@ -0,0 +1,13 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1'); +FILE_NAME('','2023-02-03T21:16:13',(),(),'IfcOpenShell v0.7.0-07ee62eb9','IfcOpenShell v0.7.0-07ee62eb9',''); +FILE_SCHEMA(('IFC4')); +ENDSEC; +DATA; +#1=IFCWALL('1UOYuAj$n3Eh15fN9iF8Og',$,$,$,$,$,$,$,$); +#2=IFCPROPERTYSINGLEVALUE('LoadBearing',$,IFCBOOLEAN(.T.),$); +#3=IFCPROPERTYSET('2E03_GdcD9U9$3EUFKulRk',$,'Pset_WallCommon',$,(#2)); +#4=IFCRELDEFINESBYPROPERTIES('1Nzz1wQsn21uJ79N6eu2uR',$,$,$,(#1),#3); +ENDSEC; +END-ISO-10303-21; diff --git a/src/ifcopenshell-python/test/fixtures/rules/pass-wall-different-psets.ifc b/src/ifcopenshell-python/test/fixtures/rules/pass-wall-different-psets.ifc new file mode 100644 index 0000000000..aa9a823fcd --- /dev/null +++ b/src/ifcopenshell-python/test/fixtures/rules/pass-wall-different-psets.ifc @@ -0,0 +1,16 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1'); +FILE_NAME('','2023-02-03T21:16:13',(),(),'IfcOpenShell v0.7.0-07ee62eb9','IfcOpenShell v0.7.0-07ee62eb9',''); +FILE_SCHEMA(('IFC4')); +ENDSEC; +DATA; +#1=IFCWALL('02EXNQlQv9CwoLzo6Bc0me',$,$,$,$,$,$,$,$); +#2=IFCPROPERTYSINGLEVALUE('LoadBearing',$,IFCBOOLEAN(.T.),$); +#3=IFCPROPERTYSET('1QVR7DL$T5HffMEtN$1c$f',$,'Pset_WallCommon',$,(#2)); +#4=IFCRELDEFINESBYPROPERTIES('3ehREYFrnEm8I_CqyEqFB_',$,$,$,(#1),#3); +#5=IFCPROPERTYSINGLEVALUE('IsBeautiful',$,IFCBOOLEAN(.T.),$); +#6=IFCPROPERTYSET('1UhGPJiqTAbggdgtPqouEw',$,'Custom',$,(#5)); +#7=IFCRELDEFINESBYPROPERTIES('2FcIkkMv94O9a1Og3cxL4M',$,$,$,(#1),#6); +ENDSEC; +END-ISO-10303-21;