From 48fc88cb70ee7b039b4552bbcaa29a31421d3454 Mon Sep 17 00:00:00 2001 From: kovacsv Date: Sat, 28 May 2022 00:38:08 +0200 Subject: [PATCH] Do not show empty property group. --- source/engine/core/core.js | 5 +++++ source/engine/import/importerbim.js | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/source/engine/core/core.js b/source/engine/core/core.js index 745dcaa..e114bcf 100644 --- a/source/engine/core/core.js +++ b/source/engine/core/core.js @@ -22,3 +22,8 @@ export function CopyObjectAttributes (src, dest) } } } + +export function IsObjectEmpty (obj) +{ + return Object.keys (obj).length === 0; +} diff --git a/source/engine/import/importerbim.js b/source/engine/import/importerbim.js index ac597aa..4055d3f 100644 --- a/source/engine/import/importerbim.js +++ b/source/engine/import/importerbim.js @@ -1,3 +1,4 @@ +import { IsObjectEmpty } from '../core/core.js'; import { Coord3D } from '../geometry/coord3d.js'; import { Direction } from '../geometry/geometry.js'; import { ArrayBufferToUtf8String } from '../io/bufferutils.js'; @@ -165,7 +166,7 @@ export class ImporterBim extends ImporterBase group.AddProperty (property); } - if (!source.info) { + if (!source.info || IsObjectEmpty (source.info)) { return; }