xeokit-sdk icon indicating copy to clipboard operation
xeokit-sdk copied to clipboard

[FEATURE SUGGESTION] Track IfcMaterial in metadata

Open g-rodigy opened this issue 2 years ago • 2 comments

It's possible to get material value on object? From metaObject or other way. In this example it is STEEL/--

image

g-rodigy avatar Sep 11 '23 21:09 g-rodigy

Use web-ifc I can find Lines with type IFCMATERIAL. Is this data available in xkt file and/or can write it easy to xkt? Some example with web-ifc in nodejs:

const {IfcAPI, IFCMATERIAL, IFCRELASSOCIATESMATERIAL}  = require("./web-ifc/web-ifc-api-node.js")
const ifcApi = new IfcAPI()
await ifcApi.Init()
const modelID = ifcApi.OpenModel(file)
const materials = ifcApi.GetLineIDsWithType(modelID, IFCMATERIAL, false)
const associates = ifcApi.GetLineIDsWithType(modelID, IFCRELASSOCIATESMATERIAL, false)

// In this example materials.get(0) is 'STEEL/--'
const materialLine = ifcApi.GetLine(modelID, materials.get(0))

for (let i = 0; i < associates.size(); i++) {
    const assoc = ifcApi.GetLine(modelID, associates.get(i))
    // Then can filter each assoc by material assoc.RelatingMaterial and get needed objects assoc.RelatedObjects
}


ifcApi.CloseModel(modelID);

Maybe has easy way to find object from example code.

g-rodigy avatar Nov 21 '23 22:11 g-rodigy

This is not currently supported, but I will however change this issue to a FEATURE SUGGESTION so we can track it as such. Thanks

xeolabs avatar Apr 20 '24 17:04 xeolabs