From 00db3d544f19fde9bf86e83a52fd0dd952b0a3c7 Mon Sep 17 00:00:00 2001 From: xeolabs Date: Thu, 19 Aug 2021 18:02:53 +0200 Subject: [PATCH] Support property sets in XKT and metadata #31 --- src/parsers/parseIFCIntoXKTModel.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/parsers/parseIFCIntoXKTModel.js b/src/parsers/parseIFCIntoXKTModel.js index b21f0846..e9497157 100644 --- a/src/parsers/parseIFCIntoXKTModel.js +++ b/src/parsers/parseIFCIntoXKTModel.js @@ -175,7 +175,10 @@ function parsePropertySets(ctx) { const metaObjectId = relatedObject.GlobalId.value; const metaObject = ctx.xktModel.metaObjects[metaObjectId]; if (metaObject) { - metaObject.propertySetId = propertySetId; + if (!metaObject.propertySetIds) { + metaObject.propertySetIds = []; + } + metaObject.propertySetIds.push(propertySetId); usedByAnyMetaObjects = true; } } @@ -195,8 +198,9 @@ function parsePropertySets(ctx) { if (nominalValue) { properties.push({ name: nominalValue.label, + type: nominalValue.type, value: nominalValue.value, - type: nominalValue.type + valueType: nominalValue.valueType }); } } @@ -252,11 +256,11 @@ function parseSpatialChildren(ctx, ifcElement, parentMetaObjectId) { function createMetaObject(ctx, ifcElement, parentMetaObjectId) { const metaObjectId = ifcElement.GlobalId.value; - const propertySetId = null; + const propertySetIds = null; const metaObjectType = ifcElement.__proto__.constructor.name; const metaObjectName = (ifcElement.Name && ifcElement.Name.value !== "") ? ifcElement.Name.value : metaObjectType; - ctx.xktModel.createMetaObject({metaObjectId, propertySetId, metaObjectType, metaObjectName, parentMetaObjectId}); + ctx.xktModel.createMetaObject({metaObjectId, propertySetIds, metaObjectType, metaObjectName, parentMetaObjectId}); ctx.stats.numMetaObjects++; }