Open g-rodigy opened 1 year ago
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.
This is not currently supported, but I will however change this issue to a FEATURE SUGGESTION so we can track it as such. Thanks
It's possible to get material value on object? From
metaObject
or other way. In this example it is STEEL/--