Skip to content
This repository has been archived by the owner on Jul 31, 2022. It is now read-only.

Commit

Permalink
Support property sets in XKT and metadata #31
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Aug 19, 2021
1 parent fc9928a commit 00db3d5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/parsers/parseIFCIntoXKTModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -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
});
}
}
Expand Down Expand Up @@ -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++;
}

Expand Down

0 comments on commit 00db3d5

Please sign in to comment.