Skip to content

Commit

Permalink
IVS-22 / BLT002 - Correct use of partitioning type attributes for win…
Browse files Browse the repository at this point in the history
…dows (#283)
  • Loading branch information
Ghesselink authored Sep 20, 2024
1 parent 84a140c commit e5a6c40
Show file tree
Hide file tree
Showing 9 changed files with 279 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@implementer-agreement
@BLT
@version1
@E00020

Feature: BLT002 - Correct use of partitioning type attributes for windows

The rule verifies that attribute UserDefinedPartitioningType is provided only when
the value of the attribute PartitioningType is set to USERDEFINED.

Scenario Outline: Correct values for PartitioningType and UserDefinedPartitioningType

Given an <entity>
Given UserDefinedPartitioningType = not empty
Given IsTypedBy = empty

Then PartitioningType = 'USERDEFINED'

Examples:
| entity |
| IfcWindow |
| IfcWindowType |


Scenario: Correct IfcPartitioningType with relating type object

Given an IfcWindow
Given a relationship IfcRelDefinesByType to IfcWindow from IfcWindowType

Then PartitioningType is empty
10 changes: 10 additions & 0 deletions test/files/blt002/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| File name | Expected result | Description |
| --- | --- | --- |
| pass-blt002-scenario01\_correct\_partitioning\_type.ifc | pass | NaN |
| pass-blt002-scenario01-no\_user\_defined\_partitioning\_type.ifc | pass | NaN |
| pass-blt002-scenario02-window\_type\_no\_own\_partitioning\_type.ifc | pass | NaN |
| fail-blt002-scenario01-operation\_type\_double\_panel\_horizontal.ifc | fail | Result 1: {'Instance\_id': '', 'Expected': ' value : USERDEFINED ', 'Observed': ' value : SINGLE\_SWING\_RIGHT '} |
| fail-blt002-scenario01-operation\_type\_swing\_fixed\_right.ifc | fail | Result 1: {'Instance\_id': '', 'Expected': ' value : USERDEFINED ', 'Observed': ' value : SWING\_FIXED\_RIGHT '} |
| fail-blt002-scenario01-operation\_type\_single\_swing\_window\_type.ifc | fail | Result 1: {'Instance\_id': '', 'Expected': ' value : USERDEFINED ', 'Observed': ' value : () '} |
| fail-blt002-scenario02-window\_type\_own\_partitioning\_type.ifc | fail | Result 1: {'Instance\_id': '', 'Expected': ' value : () ', 'Observed': ' value : SLIDING\_TO\_RIGHT '} |

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1');
FILE_NAME('','2024-09-19T11:00:11',(''),(''),'IfcOpenShell-0.7.11-d51fa2c5f','IfcOpenShell-0.7.11-d51fa2c5f','');
FILE_SCHEMA(('IFC4X3_ADD2'));
ENDSEC;
DATA;
#1=IFCPERSON($,$,'',$,$,$,$,$);
#2=IFCORGANIZATION($,'',$,$,$);
#3=IFCPERSONANDORGANIZATION(#1,#2,$);
#4=IFCAPPLICATION(#2,'0.7.11-d51fa2c5f','IfcOpenShell-0.7.11-d51fa2c5f','');
#5=IFCOWNERHISTORY(#3,#4,$,.NOTDEFINED.,$,#3,#4,1726743611);
#6=IFCDIRECTION((1.,0.,0.));
#7=IFCDIRECTION((0.,0.,1.));
#8=IFCCARTESIANPOINT((0.,0.,0.));
#9=IFCAXIS2PLACEMENT3D(#8,#7,#6);
#10=IFCDIRECTION((0.,1.));
#11=IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,1.E-05,#9,#10);
#12=IFCDIMENSIONALEXPONENTS(0,0,0,0,0,0,0);
#13=IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);
#14=IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.);
#15=IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.);
#16=IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.);
#17=IFCMEASUREWITHUNIT(IFCPLANEANGLEMEASURE(0.017453292519943295),#16);
#18=IFCCONVERSIONBASEDUNIT(#12,.PLANEANGLEUNIT.,'DEGREE',#17);
#19=IFCUNITASSIGNMENT((#13,#14,#15,#18));
#20=IFCPROJECT('074N600Dn9QwY6$fLMt361',#5,'',$,$,$,$,(#11),#19);
#21=IFCWINDOW('2jah$TSoDE9vDvOZazKvLS',$,$,$,$,$,$,$,$,$,$,.DOUBLE_PANEL_HORIZONTAL.,'TestWindow');
#22=IFCWINDOW('2gSVSjv5vBi92jXULhiXhm',#21,$,$,$,$,$,$,$,$,$,$,$);
ENDSEC;
END-ISO-10303-21;
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1');
FILE_NAME('','2024-09-19T11:00:11',(''),(''),'IfcOpenShell-0.7.11-d51fa2c5f','IfcOpenShell-0.7.11-d51fa2c5f','');
FILE_SCHEMA(('IFC4X3_ADD2'));
ENDSEC;
DATA;
#1=IFCPERSON($,$,'',$,$,$,$,$);
#2=IFCORGANIZATION($,'',$,$,$);
#3=IFCPERSONANDORGANIZATION(#1,#2,$);
#4=IFCAPPLICATION(#2,'0.7.11-d51fa2c5f','IfcOpenShell-0.7.11-d51fa2c5f','');
#5=IFCOWNERHISTORY(#3,#4,$,.NOTDEFINED.,$,#3,#4,1726743611);
#6=IFCDIRECTION((1.,0.,0.));
#7=IFCDIRECTION((0.,0.,1.));
#8=IFCCARTESIANPOINT((0.,0.,0.));
#9=IFCAXIS2PLACEMENT3D(#8,#7,#6);
#10=IFCDIRECTION((0.,1.));
#11=IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,1.E-05,#9,#10);
#12=IFCDIMENSIONALEXPONENTS(0,0,0,0,0,0,0);
#13=IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);
#14=IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.);
#15=IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.);
#16=IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.);
#17=IFCMEASUREWITHUNIT(IFCPLANEANGLEMEASURE(0.017453292519943295),#16);
#18=IFCCONVERSIONBASEDUNIT(#12,.PLANEANGLEUNIT.,'DEGREE',#17);
#19=IFCUNITASSIGNMENT((#13,#14,#15,#18));
#20=IFCPROJECT('3u_1aYxET9xvnzA5rk8EYW',#5,'',$,$,$,$,(#11),#19);
#21=IFCWINDOW('1qKmj1$5b0ZBl7cAad7$oX',$,$,$,$,$,$,$,$,$,$,.TRIPLE_PANEL_LEFT.,'TestWindow');
#22=IFCWINDOW('0dOxcBMr55T8Bwp4O7lkh3',#21,$,$,$,$,$,$,$,$,$,$,$);
ENDSEC;
END-ISO-10303-21;
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1');
FILE_NAME('','2024-09-19T11:00:11',(''),(''),'IfcOpenShell-0.7.11-d51fa2c5f','IfcOpenShell-0.7.11-d51fa2c5f','');
FILE_SCHEMA(('IFC4X3_ADD2'));
ENDSEC;
DATA;
#1=IFCPERSON($,$,'',$,$,$,$,$);
#2=IFCORGANIZATION($,'',$,$,$);
#3=IFCPERSONANDORGANIZATION(#1,#2,$);
#4=IFCAPPLICATION(#2,'0.7.11-d51fa2c5f','IfcOpenShell-0.7.11-d51fa2c5f','');
#5=IFCOWNERHISTORY(#3,#4,$,.NOTDEFINED.,$,#3,#4,1726743611);
#6=IFCDIRECTION((1.,0.,0.));
#7=IFCDIRECTION((0.,0.,1.));
#8=IFCCARTESIANPOINT((0.,0.,0.));
#9=IFCAXIS2PLACEMENT3D(#8,#7,#6);
#10=IFCDIRECTION((0.,1.));
#11=IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,1.E-05,#9,#10);
#12=IFCDIMENSIONALEXPONENTS(0,0,0,0,0,0,0);
#13=IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);
#14=IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.);
#15=IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.);
#16=IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.);
#17=IFCMEASUREWITHUNIT(IFCPLANEANGLEMEASURE(0.017453292519943295),#16);
#18=IFCCONVERSIONBASEDUNIT(#12,.PLANEANGLEUNIT.,'DEGREE',#17);
#19=IFCUNITASSIGNMENT((#13,#14,#15,#18));
#20=IFCPROJECT('2ztGNB5ufECgc8ppEQGFiy',#5,'',$,$,$,$,(#11),#19);
#21=IFCWINDOWTYPE('3S1V3jwfH8t8sDIt$LQ7nX',$,$,$,$,$,$,$,$,$,$,$,$);
#22=IFCWINDOW('23k9bTXorFLu$A3B3ZF2ou',$,$,$,$,$,$,$,$,$,$,.TRIPLE_PANEL_VERTICAL.,$);
#23=IFCRELDEFINESBYTYPE('3$MxPhyzX4WvFEF_PWfEyG',$,$,$,(#22),#21);
ENDSEC;
END-ISO-10303-21;
53 changes: 53 additions & 0 deletions test/files/blt002/generate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import ifcopenshell
import ifcopenshell.template


file = ifcopenshell.template.create(schema_identifier='IFC4X3_ADD2')

file.createIfcWindow(ifcopenshell.guid.new())

file.write('na-blt002-scenario01-no_user_defined_Partitioning_type.ifc')

file = ifcopenshell.template.create(schema_identifier='IFC4X3_ADD2')

file.createIfcWindow(ifcopenshell.guid.new(),
UserDefinedPartitioningType = 'TestWindow',
PartitioningType = 'USERDEFINED')

file.write('pass-blt002-scenario01_correct_Partitioning_type.ifc')


for i in ['double_panel_horizontal', 'triple_panel_left']:
file = ifcopenshell.template.create(schema_identifier='IFC4X3_ADD2')
file.createIfcWindow(ifcopenshell.guid.new(),
file.createIfcWindow(ifcopenshell.guid.new(),
UserDefinedPartitioningType = 'TestWindow',
PartitioningType = i.upper()))
file.write(f'fail-blt002-scenario01-Partitioning_type_{i}.ifc')



file = ifcopenshell.template.create(schema_identifier='IFC4X3_ADD2')

file.createIfcRelDefinesByType(
ifcopenshell.guid.new(),
RelatingType = file.createIfcWindowType(ifcopenshell.guid.new()),
RelatedObjects = [file.createIfcWindow(
ifcopenshell.guid.new(),
)]
)

file.write('pass-blt002-scenario02-window_type_no_own_Partitioning_type.ifc')

file = ifcopenshell.template.create(schema_identifier='IFC4X3_ADD2')

file.createIfcRelDefinesByType(
ifcopenshell.guid.new(),
RelatingType = file.createIfcWindowType(ifcopenshell.guid.new()),
RelatedObjects = [file.createIfcWindow(
ifcopenshell.guid.new(),
PartitioningType = 'TRIPLE_PANEL_VERTICAL'
)]
)

file.write('fail-blt002-scenario02-Window_type_own_Partitioning_type.ifc')
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1');
FILE_NAME('','2024-09-19T11:00:11',(''),(''),'IfcOpenShell-0.7.11-d51fa2c5f','IfcOpenShell-0.7.11-d51fa2c5f','');
FILE_SCHEMA(('IFC4X3_ADD2'));
ENDSEC;
DATA;
#1=IFCPERSON($,$,'',$,$,$,$,$);
#2=IFCORGANIZATION($,'',$,$,$);
#3=IFCPERSONANDORGANIZATION(#1,#2,$);
#4=IFCAPPLICATION(#2,'0.7.11-d51fa2c5f','IfcOpenShell-0.7.11-d51fa2c5f','');
#5=IFCOWNERHISTORY(#3,#4,$,.NOTDEFINED.,$,#3,#4,1726743611);
#6=IFCDIRECTION((1.,0.,0.));
#7=IFCDIRECTION((0.,0.,1.));
#8=IFCCARTESIANPOINT((0.,0.,0.));
#9=IFCAXIS2PLACEMENT3D(#8,#7,#6);
#10=IFCDIRECTION((0.,1.));
#11=IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,1.E-05,#9,#10);
#12=IFCDIMENSIONALEXPONENTS(0,0,0,0,0,0,0);
#13=IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);
#14=IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.);
#15=IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.);
#16=IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.);
#17=IFCMEASUREWITHUNIT(IFCPLANEANGLEMEASURE(0.017453292519943295),#16);
#18=IFCCONVERSIONBASEDUNIT(#12,.PLANEANGLEUNIT.,'DEGREE',#17);
#19=IFCUNITASSIGNMENT((#13,#14,#15,#18));
#20=IFCPROJECT('0Q8pOUdKb29xDobY3RQKzF',#5,'',$,$,$,$,(#11),#19);
#21=IFCWINDOW('2IISuX895AFgBDiw2Sjl8y',$,$,$,$,$,$,$,$,$,$,$,$);
ENDSEC;
END-ISO-10303-21;
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1');
FILE_NAME('','2024-09-19T11:00:11',(''),(''),'IfcOpenShell-0.7.11-d51fa2c5f','IfcOpenShell-0.7.11-d51fa2c5f','');
FILE_SCHEMA(('IFC4X3_ADD2'));
ENDSEC;
DATA;
#1=IFCPERSON($,$,'',$,$,$,$,$);
#2=IFCORGANIZATION($,'',$,$,$);
#3=IFCPERSONANDORGANIZATION(#1,#2,$);
#4=IFCAPPLICATION(#2,'0.7.11-d51fa2c5f','IfcOpenShell-0.7.11-d51fa2c5f','');
#5=IFCOWNERHISTORY(#3,#4,$,.NOTDEFINED.,$,#3,#4,1726743611);
#6=IFCDIRECTION((1.,0.,0.));
#7=IFCDIRECTION((0.,0.,1.));
#8=IFCCARTESIANPOINT((0.,0.,0.));
#9=IFCAXIS2PLACEMENT3D(#8,#7,#6);
#10=IFCDIRECTION((0.,1.));
#11=IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,1.E-05,#9,#10);
#12=IFCDIMENSIONALEXPONENTS(0,0,0,0,0,0,0);
#13=IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);
#14=IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.);
#15=IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.);
#16=IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.);
#17=IFCMEASUREWITHUNIT(IFCPLANEANGLEMEASURE(0.017453292519943295),#16);
#18=IFCCONVERSIONBASEDUNIT(#12,.PLANEANGLEUNIT.,'DEGREE',#17);
#19=IFCUNITASSIGNMENT((#13,#14,#15,#18));
#20=IFCPROJECT('1YznUD7Pz3UPf_MEx_FesK',#5,'',$,$,$,$,(#11),#19);
#21=IFCWINDOW('0kurpAVMX08uHZ_W$1mWtw',$,$,$,$,$,$,$,$,$,$,.USERDEFINED.,'TestWindow');
ENDSEC;
END-ISO-10303-21;
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1');
FILE_NAME('','2024-09-19T11:00:11',(''),(''),'IfcOpenShell-0.7.11-d51fa2c5f','IfcOpenShell-0.7.11-d51fa2c5f','');
FILE_SCHEMA(('IFC4X3_ADD2'));
ENDSEC;
DATA;
#1=IFCPERSON($,$,'',$,$,$,$,$);
#2=IFCORGANIZATION($,'',$,$,$);
#3=IFCPERSONANDORGANIZATION(#1,#2,$);
#4=IFCAPPLICATION(#2,'0.7.11-d51fa2c5f','IfcOpenShell-0.7.11-d51fa2c5f','');
#5=IFCOWNERHISTORY(#3,#4,$,.NOTDEFINED.,$,#3,#4,1726743611);
#6=IFCDIRECTION((1.,0.,0.));
#7=IFCDIRECTION((0.,0.,1.));
#8=IFCCARTESIANPOINT((0.,0.,0.));
#9=IFCAXIS2PLACEMENT3D(#8,#7,#6);
#10=IFCDIRECTION((0.,1.));
#11=IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,1.E-05,#9,#10);
#12=IFCDIMENSIONALEXPONENTS(0,0,0,0,0,0,0);
#13=IFCSIUNIT(*,.LENGTHUNIT.,$,.METRE.);
#14=IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.);
#15=IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.);
#16=IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.);
#17=IFCMEASUREWITHUNIT(IFCPLANEANGLEMEASURE(0.017453292519943295),#16);
#18=IFCCONVERSIONBASEDUNIT(#12,.PLANEANGLEUNIT.,'DEGREE',#17);
#19=IFCUNITASSIGNMENT((#13,#14,#15,#18));
#20=IFCPROJECT('0qVrR3PRb3AQ5hCvtE3V2L',#5,'',$,$,$,$,(#11),#19);
#21=IFCWINDOWTYPE('3FrDa8hwLFreay2Xx50KkI',$,$,$,$,$,$,$,$,$,$,$,$);
#22=IFCWINDOW('0SWASAndz4xxZ5wxBCt9FH',$,$,$,$,$,$,$,$,$,$,$,$);
#23=IFCRELDEFINESBYTYPE('2el_5DDKb8uA7IbR6pIgIB',$,$,$,(#22),#21);
ENDSEC;
END-ISO-10303-21;

0 comments on commit e5a6c40

Please sign in to comment.