View IFC Element Properties

Hello,

I am new to IFC file format and specifically working with IFC.js. I am looking for a solution to view an element properties hierarchy.

Thank you!

Hi! Did you see this tutorial? Keep in mind that for creating the GUI elements (menus, etc) you will need some basic web development knowledge (at least HTML, CSS, JS, etc) that falls out of the scope of the library itself. Cheers!

https://ifcjs.github.io/info/docs/Guide/web-ifc-three/Tutorials/Properties

By this code snippet I am trying to log into console all properties of a selected element.

async function getPropertyStruct(ifcManager, modelID, expressID, propObject) {
  const itemProperties = await ifcManager.getItemProperties(
    modelID,
    expressID,
    true
  );
  console.log("itemProperties = " + itemProperties.toString());

But eventually I can only see this in console:

itemProperties = [object Object]

How can all properties be logged in a tree-view representation?

Hi, that happens because on JavaScript you can’t just convert an object to a string using .toString(). You could traverse the content of that object to log them in the console. My suggestion is to get a bit more familiar with JavaScript and web development before diving into IFC.js.

In the future, if you could ask this question in the IFC.js Discord channel it would be more helpful. Cheers!

1 Like

Thanks, JSON.Stringify() just did the trick for now :slight_smile: