From 6b07aeb70303bda88f6e84ffaee066096edd29a3 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sun, 12 Jul 2020 10:19:22 +1000 Subject: [PATCH] Allow export of positioning elements (only IfcGrid for now) See #911 --- src/ifcblenderexport/blenderbim/bim/prop.py | 1 + src/ifcblenderexport/blenderbim/bim/schema.py | 1 + .../schema/IfcPositioningElement_IFC4.json | 77 +++++++++++++++++++ src/ifcblenderexport/getIfcElements.py | 3 +- 4 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 src/ifcblenderexport/blenderbim/bim/schema/IfcPositioningElement_IFC4.json diff --git a/src/ifcblenderexport/blenderbim/bim/prop.py b/src/ifcblenderexport/blenderbim/bim/prop.py index 3e70d095c7..940225bbc8 100644 --- a/src/ifcblenderexport/blenderbim/bim/prop.py +++ b/src/ifcblenderexport/blenderbim/bim/prop.py @@ -130,6 +130,7 @@ def getIfcProducts(self, context): 'IfcSpatialElement', 'IfcGroup', 'IfcStructural', + 'IfcPositioningElement', 'IfcContext', 'IfcAnnotation']]) return products_enum diff --git a/src/ifcblenderexport/blenderbim/bim/schema.py b/src/ifcblenderexport/blenderbim/bim/schema.py index 4e40b0488d..4298b81042 100644 --- a/src/ifcblenderexport/blenderbim/bim/schema.py +++ b/src/ifcblenderexport/blenderbim/bim/schema.py @@ -17,6 +17,7 @@ class IfcSchema(): 'IfcSpatialElement', 'IfcGroup', 'IfcStructural', + 'IfcPositioningElement', 'IfcMaterialDefinition', 'IfcParameterizedProfileDef', 'IfcBoundaryCondition', diff --git a/src/ifcblenderexport/blenderbim/bim/schema/IfcPositioningElement_IFC4.json b/src/ifcblenderexport/blenderbim/bim/schema/IfcPositioningElement_IFC4.json new file mode 100644 index 0000000000..7702b8ffff --- /dev/null +++ b/src/ifcblenderexport/blenderbim/bim/schema/IfcPositioningElement_IFC4.json @@ -0,0 +1,77 @@ +{ + "IfcGrid": { + "is_abstract": false, + "parent": "IfcProduct", + "attributes": [ + { + "name": "GlobalId", + "type": "IfcGloballyUniqueId", + "is_enum": false, + "enum_values": [] + }, + { + "name": "Name", + "type": "IfcLabel", + "is_enum": false, + "enum_values": [] + }, + { + "name": "Description", + "type": "IfcText", + "is_enum": false, + "enum_values": [] + }, + { + "name": "ObjectType", + "type": "IfcLabel", + "is_enum": false, + "enum_values": [] + }, + { + "name": "PredefinedType", + "type": "IfcGridTypeEnum", + "is_enum": true, + "enum_values": [ + "RECTANGULAR", + "RADIAL", + "TRIANGULAR", + "IRREGULAR", + "USERDEFINED", + "NOTDEFINED" + ] + } + ], + "complex_attributes": [ + { + "name": "OwnerHistory", + "type": "IfcOwnerHistory", + "is_select": false, + "select_types": [] + }, + { + "name": "IsDeclaredBy", + "type": "IfcRelDefinesByObject", + "is_select": false, + "select_types": [] + }, + { + "name": "IsTypedBy", + "type": "IfcRelDefinesByType", + "is_select": false, + "select_types": [] + }, + { + "name": "ObjectPlacement", + "type": "IfcObjectPlacement", + "is_select": false, + "select_types": [] + }, + { + "name": "Representation", + "type": "IfcProductRepresentation", + "is_select": false, + "select_types": [] + } + ] + } +} \ No newline at end of file diff --git a/src/ifcblenderexport/getIfcElements.py b/src/ifcblenderexport/getIfcElements.py index 775d1ced5a..9f29c89c02 100644 --- a/src/ifcblenderexport/getIfcElements.py +++ b/src/ifcblenderexport/getIfcElements.py @@ -157,7 +157,8 @@ filename_filters = { 'IfcParameterizedProfileDef_IFC4.json': ['IfcParameterizedProfileDef'], 'IfcBoundaryCondition_IFC4.json': ['IfcBoundaryCondition'], 'IfcElementType_IFC4.json': ['IfcElementType', 'IfcSpatialElementType'], - 'IfcAnnotation_IFC4.json': ['IfcAnnotation'] + 'IfcAnnotation_IFC4.json': ['IfcAnnotation'], + 'IfcPositioningElement_IFC4.json': ['IfcGrid'] # IfcPositioningElement in the future } for filename, filters in filename_filters.items():